dimanche 22 mars 2015

Is there a JavaScript spy/mock/stub library that doesn't use eval?

I have an HTML5 app that targets Firefox OS, among others. Packaged apps in Firefox OS can't use eval. (A CSP of



default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'


is in force and can't be relaxed.) My app does not itself use eval, but the spy/mock/stub libraries I know of, such as Sinon, do. So my unit tests that use a spy, mock or stub fail when running under Firefox OS. (They succeed in a regular browser.) Obviously, I could manually create spies, mocks and stubs, but I'd rather not re-invent the wheel.


Is there a JavaScript spy/mock/stub library that doesn't use eval?


Aucun commentaire:

Enregistrer un commentaire