-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpecRunner.js
executable file
·54 lines (49 loc) · 1.72 KB
/
SpecRunner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(function() {
'use strict';
// Configure RequireJS to shim Jasmine
require.config({
baseUrl: '',
paths: {
'jasmine': 'node_modules/jasmine-core/lib/jasmine-core/jasmine',
'jasmine-html': 'node_modules/jasmine-core/lib/jasmine-core/jasmine-html',
'boot': 'node_modules/jasmine-core/lib/jasmine-core/boot',
'console': 'node_modules/jasmine-core/lib/console/console',
'bean': 'node_modules/bean/bean',
'qwery': 'node_modules/qwery/qwery',
'reqwest': 'node_modules/reqwest/reqwest',
'extendjs': 'vendor/lib/extend'
},
shim: {
'jasmine': {
exports: 'window.jasmineRequire'
},
'jasmine-html': {
deps: ['jasmine'],
exports: 'window.jasmineRequire'
},
'boot': {
deps: ['jasmine', 'jasmine-html'],
exports: 'window.jasmineRequire'
},
'console': {
deps: ['jasmine'],
exports: 'window.jasmineRequire'
}
}
});
// Define all of your specs here. These are RequireJS modules.
var specs = [
'src/tests/unit/lib/core/modelSpec'
];
// Load Jasmine - This will still create all of the normal Jasmine browser globals unless `boot.js` is re-written to use the
// AMD or UMD specs. `boot.js` will do a bunch of configuration and attach it's initializers to `window.onload()`. Because
// we are using RequireJS `window.onload()` has already been triggered so we have to manually call it again. This will
// initialize the HTML Reporter and execute the environment.
require(['boot'], function () {
// Load the specs
require(specs, function () {
// Initialize the HTML Reporter and execute the environment (setup by `boot.js`)
window.onload();
});
});
})();