-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-tests.js
42 lines (35 loc) · 1.12 KB
/
main-tests.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
const { throws, deepEqual } = require('assert');
const mod = require('./main');
describe('OLSKRollupScaffoldDefaultConfiguration', function test_OLSKRollupScaffoldDefaultConfiguration() {
it('throws error if not object', function() {
throws(function() {
mod.OLSKRollupScaffoldDefaultConfiguration(null);
}, /OLSKErrorInputNotValid/);
});
it('throws error if OLSKRollupStartDirectory not string', function() {
throws(function() {
mod.OLSKRollupScaffoldDefaultConfiguration({
OLSKRollupStartDirectory: null,
});
}, /OLSKErrorInputNotValid/);
});
it('returns object', function() {
deepEqual(mod.OLSKRollupScaffoldDefaultConfiguration({
OLSKRollupStartDirectory: 'alfa/bravo',
}), {
input: 'alfa/bravo/rollup-start.js',
output: {
sourcemap: true,
format: 'iife',
name: 'Main',
file: 'alfa/bravo/__compiled/ui-behaviour.js',
},
onwarn: mod._OLSKRollupScaffoldDefaultConfigurationWarnHandler,
});
});
it('returns object', function() {
deepEqual(mod.OLSKRollupScaffoldDefaultConfiguration({
OLSKRollupStartDirectory: 'alfa/XYZBravo',
}).output.name, 'XYZBravo');
});
});