Can I Pass Emissions With a Check Engine Light On?
Short answer: usually no
In most US states that use OBD-II testing, an illuminated check engine light with a stored emissions code is an automatic fail. Rules differ by state, so check your state program.
Why clearing codes does not work
When codes are cleared, the car resets its readiness monitors. Inspection stations check those monitors, and too many incomplete monitors also fail the test. Monitors need days of normal driving to complete.
What to do
Fix the underlying problem, then drive normally for several days including some highway driving before the test. Common emissions codes include P0420 and P0455.
Repair waivers
Some states offer waivers when you have spent a set amount on qualifying repairs. Ask your state emissions program.