-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathkarma-debug.conf.js
More file actions
65 lines (55 loc) · 1.76 KB
/
karma-debug.conf.js
File metadata and controls
65 lines (55 loc) · 1.76 KB
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
55
56
57
58
59
60
61
62
63
64
65
// Karma configuration - Specific for the large debug build
const fs = require('fs');
const path = require('path');
// --- Dynamic Build File Selection ---
// Get the target build file from an environment variable.
// Default to the most stable production build if not specified.
const buildFileToTest = process.env.BUILD_TARGET || 'artoolkitNFT.min.js';
const buildFilePath = path.join('build', buildFileToTest);
if (!fs.existsSync(buildFilePath)) {
console.error(`[Karma] Error: Build file not found: ${buildFilePath}`);
console.error(`[Karma] Please run the build script first, or specify a valid BUILD_TARGET.`);
process.exit(1);
}
console.log(`[Karma] Using build file for testing: ${buildFilePath}`);
// --- End Dynamic Selection ---
module.exports = function (config) {
config.set({
basePath: "",
frameworks: ["jasmine"],
plugins: ['karma-jasmine', 'karma-chrome-launcher'],
// Dynamically load the selected build file.
// No setup script is needed; the test file handles initialization.
files: [
buildFilePath,
'tests/tests.test.js', // The single, unified test file
{
pattern: 'examples/Data/*',
watched: false,
included: false,
served: true,
nocache: false
}
],
proxies: {
'/examples/Data/': '/base/examples/Data/'
},
exclude: [],
preprocessors: {},
reporters: ["progress"],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ["ChromeHeadless"],
singleRun: true,
concurrency: Infinity,
client: {
clearContext: false,
jasmine: {
// A much more generous timeout for the large debug build
DEFAULT_TIMEOUT_INTERVAL: 40000
}
}
});
};