Home:ALL Converter>Testing minified javascript

Testing minified javascript

Ask Time:2010-02-21T18:00:50         Author:readonly

Json Formatter

Should we test the minified versions of our javascript files as we develop them, or is it an extremely low risk that the minified javascript does not differ in function from the un-minified version?

Author:readonly,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/2305515/testing-minified-javascript
Ignacio Vazquez-Abrams :

Running your test suites against them should be enough.\n\n...\n\nYou do have test suites... right?",
2010-02-21T10:05:19
Svante Svenson :

Run them through jslint before minifying them and if they pass that they should minify without a problem. The key here is to not forget a ; since minifying will remove all linefeeds. Also declaring variables helps the minifying process, but not doing so will not break anything by minifying.",
2010-02-21T10:06:16
Sarfraz :

I have not seen any of my scripts behaving differently so far after minifying them but sill i do test them before making them public just to make sure everything has been done correctly. \n\nAnd you are supposed to sort of test it before using/making it public just to make sure that it works the way you wanted.\n\nIf you have done everything correctly in non-minified version, it should be not a problem.",
2010-02-21T10:06:13
yy