Your vehicle will fail the smog check if the Service Engine Soon Light is on. The smog technician will connect the smog test machine to your vehicle's Data Link Connector. The information from the engine control unit (ECU) will transmit the Service Engine Soon Light status, along with the stored trouble code(s) which caused the SES to turn on to the smog test machine; and subsequently, your vehicle will fail the smog inspection. The Service Engine Soon Light is there to inform drivers that the ECU has detected a fault which may cause an increase in harmful engine emissions.
Now if the SES is off, and you try to get the vehicle to pass the test, it may or may not pass the inspection depending on the whether the fault causing the SES to illuminate also caused any of the emission monitor(s) to not become ready. Depending on your vehicle's model year and whether it is diesel or gasoline powered, many of it's
emission monitors (also known as readiness flags) must be in READY or in COMPLETED status in order to pass the smog test. It is quite possible that the same issue causing the SES to turn on, also cause one monitor (or multiple) to unset. Should this be the case, you vehicle will not pass the smog check even with the SES light off.
Our recommendation is to have a smog check repair center retrieve the stored trouble code(s) from your vehicle's ECU and repair the fault prior to getting a smog test.