-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
start.js
53 lines (44 loc) · 1.44 KB
/
start.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
// Launch script for various Node test configurations
// Enables ES2015 import/export in Node.js
require('reify');
require('../../../aliases');
/* global process */
const mode = process.argv.length >= 3 ? process.argv[2] : 'default';
console.log(`Running ${mode} tests...`); // eslint-disable-line
switch (mode) {
case 'render':
{
// This is the script that runs in Node.js and starts the browser
const {RenderTestDriver} = require('deck.gl-test-utils');
new RenderTestDriver().run({
process: 'webpack-dev-server',
parameters: ['--env.render']
});
}
break;
case 'render-react':
{
// This is the script that runs in Node.js and starts the browser
const {RenderTestDriver} = require('deck.gl-test-utils');
new RenderTestDriver().run({
process: 'webpack-dev-server',
parameters: ['--env.render-react']
});
}
break;
case 'bench':
require('./bench-index'); // Run the benchmarks
break;
case 'test-dist':
// Load deck.gl itself from the dist folder
const path = require('path');
const moduleAlias = require('module-alias');
moduleAlias.addAlias('deck.gl/test/data', path.resolve(__dirname, '../../../test/data'));
moduleAlias.addAlias('deck.gl', path.resolve(__dirname, '../../../dist'));
require('./test-index'); // Run the tests
break;
case 'test':
default:
require('./test-index'); // Run the tests
break;
}