1 | "use strict";
|
2 | intern.registerLoader(function (options) {
|
3 | options.baseURL = options.baseURL || intern.config.basePath;
|
4 | var globalObj = typeof window !== 'undefined' ? window : global;
|
5 | if (intern.environment === 'browser') {
|
6 | return intern
|
7 | .loadScript('node_modules/systemjs/dist/system.src.js')
|
8 | .then(function () {
|
9 | return configAndLoad(SystemJS);
|
10 | });
|
11 | }
|
12 | else {
|
13 | var SystemJS_1 = (globalObj.require || require)('systemjs');
|
14 | return configAndLoad(SystemJS_1);
|
15 | }
|
16 | function configAndLoad(loader) {
|
17 | intern.log('Using SystemJS loader');
|
18 | intern.log('Configuring SystemJS with:', options);
|
19 | loader.config(options);
|
20 | return function (modules) {
|
21 | intern.log('Loading modules with SystemJS:', modules);
|
22 | return modules.reduce(function (previous, suite) {
|
23 | if (previous) {
|
24 | return previous.then(function () { return loader.import(suite); });
|
25 | }
|
26 | return loader.import(suite);
|
27 | }, null);
|
28 | };
|
29 | }
|
30 | });
|
31 |
|
\ | No newline at end of file |