Just FYI, I think having JS code (in a string), parsing, transforming, generating JS code and asserting that (probably with ignoring whitespaces or something) would be much more readable test. Can you add at least one test like this - as a higher level test ?