This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
forked from mongodb-js/mongodb-extjson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
69 lines (63 loc) · 1.66 KB
/
karma.conf.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'use strict';
const scenariosPlugin = require('./tools/scenarios-plugin');
const nodeGlobals = require('rollup-plugin-node-globals');
const nodeBuiltins = require('rollup-plugin-node-builtins');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');
const rollupPlugins = [
scenariosPlugin(),
nodeResolve({
browser: true,
preferBuiltins: false
}),
commonjs({
namedExports: {
'node_modules/buffer/index.js': ['isBuffer'] // indicate that isBuffer is exported by the buffer module to avoid preprocessing error
}
}),
nodeBuiltins(),
nodeGlobals()
];
const rollupConfig = {
plugins: rollupPlugins,
output: {
format: 'iife',
name: 'BSONtest',
exports: 'named'
}
};
// silence rollup warnings for circular dependencies in node_modules, use of eval function
const onwarn = warning => {
if (
(warning.code === 'CIRCULAR_DEPENDENCY' && warning.importer.includes('node_modules')) ||
warning.code === 'EVAL'
)
return;
console.warn(warning.toString());
};
rollupConfig.onwarn = onwarn;
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
reporters: ['mocha'],
files: [{ pattern: 'test/*.js', watched: false }],
preprocessors: {
'test/*.js': 'rollup'
},
rollupPreprocessor: rollupConfig,
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
singleRun: true,
concurrency: Infinity
});
};