My unit tests are contained in a module that is loaded from an HTML page using SystemJS.
<script src="node_modules/systemjs/dist/system.src.js"></script> <script src="node_modules/rxjs/bundles/Rx.js"></script> <script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script> <script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script> <script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"></script> <script> System.config({ defaultJSExtensions: true, map: { "angular2": 'http://localhost:8000/angular2', "rxjs": 'node_modules/rxjs' }, packages: { angular2: { defaultExtension: 'js', } } }); System.import('angular2/test/http/backends/xhr_backend_spec') .then((src) => { src.main(); }); </script>
My page does not show any tests, while my main method contains a set of tests:
export function main() { console.log('in main'); describe('XHRBackend', () => { (...) }); }
I put some traces, and I check that the main function and the callback defined in the description function are called. But the tests themselves are not executed in the describe callback.
I assume that I need to wait for the module to load before starting Jasmine, but I do not know how to configure it.
Thank you for your help!
jasmine systemjs
Thierry templier
source share