We need some "framework" before we can write unit tests.
The thing should:
1) Pick tests files from e.g. a tests/ directory
2) "compile" that into temp. extension
3) Create a temp profile (mozrunner/mozbase/mozharness?)
4) A (special?) bootstrap.js would then setup and run the tests (as main)
5) A test helper/harness would provide testing methods (asserts) and do the reporting and auto-shutdown.
It also would be possible to seperate tests into xpcshell-compatible tests and those which require a full browser (comparable to mozilla xpcshell-test vs. mochitest).
It might be also feasible to fork the add-on sdk jpm tooling.
We need some "framework" before we can write unit tests.
The thing should: 1) Pick tests files from e.g. a
tests/
directory 2) "compile" that into temp. extension 3) Create a temp profile (mozrunner
/mozbase
/mozharness
?) 4) A (special?)bootstrap.js
would then setup and run the tests (asmain
) 5) A test helper/harness would provide testing methods (asserts) and do the reporting and auto-shutdown.It also would be possible to seperate tests into xpcshell-compatible tests and those which require a full browser (comparable to mozilla
xpcshell-test
vs.mochitest
).It might be also feasible to fork the add-on sdk
jpm
tooling.CC @xabolcs