This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
test-main.js
47 lines (41 loc) · 1.66 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
var allTestFiles = [];
var TEST_REGEXP = /^\/base\/tests\/.*\.js$/i;
// Get a list of all the test files to include
Object.keys(window.__karma__.files).forEach(function(file) {
"use strict";
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, "");
normalizedTestModule = "../../" + normalizedTestModule;
allTestFiles.push(normalizedTestModule);
}
});
require.config({
// Karma serves files under /base, which is the basePath from your config file
baseUrl: "/base/assets/js",
paths: {
text: "bower/requirejs-plugins/lib/text",
json: "bower/requirejs-plugins/src/json",
whispeerHelper: "helper/helper",
amanda: "bower/amanda/releases/latest/amanda",
angular: "bower/angular/angular",
angularUiRouter: "bower/angular-ui-router/release/angular-ui-router",
angularTouch: "bower/angular-touch/angular-touch",
bluebird: "bower/bluebird/js/browser/bluebird",
jquery: "bower/jquery/jquery",
requirejs: "bower/requirejs/require",
socket: "bower/socket.io-client/socket.io",
qtip: "bower/qtip2/basic/jquery.qtip",
imageLib: "bower/blueimp-load-image/js/load-image",
localizationModule: "bower/angular-i18n-directive/src/localizationModule",
PromiseWorker: "bower/require-promise-worker.js/src/index",
dexie: "bower/dexie/dist/latest/Dexie",
debug: "bower/visionmedia-debug/dist/debug"
},
// dynamically load all test files
deps: allTestFiles,
// we have to kickoff jasmine, as it is asynchronous
callback: window.__karma__.start
});