February 2019
Beginner
694 pages
18h 4m
English
As we saw with our minimal implementation earlier, the module loading process is kicked off with an initial call to the require function. Assuming that we have a very simple Jasmine test in the test/SimpleTest.ts file, we can bootstrap our test environment at the bottom of the RequireConfigSpecRunner.js file as follows:
var specs = [
'test/SimpleTest'
];
require(['jasmine-boot'], (jasmineBoot) => {
require(specs, () => {
(<any>window).onload();
});
});
This setup is interesting for a variety of reasons. Firstly, we have defined a variable named specs that is a simple string array. It contains a single entry, namely 'test/SimpleTest', which is a reference to our Jasmine test suite. Note, then, where this specs variable ...
Read now
Unlock full access