Unit testing for FirefoxOS packaged app

91 Views Asked by At

I want to write a unit testing code for a Firefox OS packaged app.

src/manifest.webapp
src/app.html
src/app.js
test/manifest.webapp
test/unittest.html
test/unittest.js

Is there a way to load app.js from unittest.html?

<script src="../src/app.js"></script>

This doesn't work when I launch unittest.html as a packaged app.

1

There are 1 best solutions below

2
On

Made an example and it works for me. Take a look at https://dl.dropboxusercontent.com/u/134884/packagedtest.zip . I tried it in a Firefox 1.2 Simulator using the App Manager from Firefox Nightly, if it makes any difference.

Something else must be the issue. Use the developer tools to connect to the simulator to see if there are any relevant errors in the console. If you are using the App Manager, just click the "Debug" button bellow the app to do that. If you are using the Simulator 1.1 add-on, click the "Connect" button next to the app.