-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-main.js
48 lines (43 loc) · 1.58 KB
/
test-main.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
var allTestFiles = []
var TEST_REGEXP = /(spec|test)\.js$/i
// Get a list of all the test files to include
Object.keys(window.__karma__.files).forEach(function (file) {
if (TEST_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
// If you require sub-dependencies of test files to be loaded as-is (requiring file extension)
// then do not normalize the paths
var normalizedTestModule = file.replace(/^\/base\/|\.js$/g, '')
allTestFiles.push(normalizedTestModule)
}
})
require.config({
// Karma serves files under /base, which is the basePath from your config file
baseUrl: '/base',
// dynamically load all test files
deps: allTestFiles,
paths: {
'chai': 'node_modules/chai/chai',
'sinon': 'node_modules/sinon/pkg/sinon',
'underscore': 'node_modules/underscore/underscore',
'jquery':'node_modules/jquery/dist/jquery',
'handlebars':'node_modules/handlebars/dist/handlebars.amd',
'text':'node_modules/requirejs-text/text',
'backbone.stickit':'node_modules/backbone.stickit/backbone.stickit',
'backbone':'node_modules/backbone/backbone',
'dw-backbone':'node_modules/dw-backbone/src/base',
'bonmot':'dist/bonmot'
},
packages: [{
// Include hbs as a package, so it will find hbs-builder when needed
name: "hbs",
location: "test/resources/hbs_libs",
main: "hbs"
}],
hbs: {
templateExtension: ".hbs",
//compilerPath: "/static/common/handlebars/handlebars-4.0.5",
compilerPath: "handlebars",
},
// we have to kickoff jasmine, as it is asynchronous
callback: window.__karma__.start
})