Don’t go for a state emissions test with a “check engine” light. Its probably is a sure sign your car will fail the test.
In California, it’s an automatic failure, even if the problem was nothing more than a loose gas cap. By the way, don’t bother trying to fool the inspection station by disconnecting the battery or using any other method to erase the trouble code and turn off the “check engine” light. Your vehicle’s computer will let the inspection station know that its codes have been erased, and you’ll just have to go back again.