It sounds like whatever repairs were done by the auto repair mechanic failed to fix the trouble causing the check engine light to turn on. Do not obtain a smog check with the check engine light on; your Nissan Frontier will fail the smog test.
Since the check engine light is now on, there should be trouble code(s) stored in your Nissan's engine control computer (ECU). An experienced smog check repair technician should be able to extract the trouble code(s) and and use that information to repair the fault which is causing the light to illuminate.
As far as having erased memory... the smog technician is correct. While the auto repair mechanic attempted to repair your truck they cleared the existing trouble codes in the computer, as well as the "emission monitors" (which is required and standard protocol). Emission monitors are internal self-tests which the computer performs to make sure the entire emission systems is functioning properly. Any time trouble codes are cleared, emission monitors are cleared as well. The only way to reset the monitors (or make the monitors READY/COMPLETE) is to drive the vehicle for 100-200 miles and over the course of a few days; in both city and highway traffic conditions. The problem with trying to make READY or COMPLETE the emission monitors by driving is that if the original emission fault was not fixed before resetting the check engine light and clearing the codes, the fault will trigger the check engine back on before or during one of the emission monitor self-test.
The solution is to have a smog check specific auto repair mechanic diagnose your Nissan Frontier's smog check failure. The repair has to be made properly, the computer reset, the vehicle be driven for a few days (and at least 100 miles), and then obtain a smog check retest.