Open stefan-walluhn opened 8 years ago
yeah, I think the basic deal is that since the file is getting loaded in the addon with Components.utils.import
(https://github.com/willscott/grunt-jasmine-firefoxaddon/blob/master/tasks/build-test-addon.js#L89) the file is loaded against the lowlevel API for addons, and doesn't have the launchpad and high-level API that JPM packaging set up loaded.
Would be happy to take a pull request if it make sense, but if you're programming in the high-level API, I think you'll do better to start from the testing tools that JPM provides, rather than this fairly brittle tool.
Unfortunately the JPM testing tools are on a very basic lever right now, producing more noise than helpful testing and debugging capabilities. This is why I was searching for a possibility to introduce a full featured test suite to my project.
Thanks for your reply. If there is some time (and mind space), I will dig into this and think about a meaningful approach.
If a jasmine test case depends on Mozilla's addon-sdk the grunt task fails with:
I was able to track this being an issue with browserify. Since the addon-sdk is only available in the firefox runtime environment but not in the node/npm-based dev environment, browserify is not able to bundle the addon-sdk modules:
I also tried to fiddle around with the addon-sdk sources to make them available in the node/npm-based dev environment to enable browserify to include the modules. Unfortunately, the addon-sdk code does not seem to run with nodejs and brakes with syntax errors.
Running test cases not depending on Mozilla's addon-sdk works out of the box. Am I missing anything in my setup? Is jasmine_firefoxaddon designed to also test against Mozilla's addon-sdk? This is my Gruntfile.js