-
Notifications
You must be signed in to change notification settings - Fork 58
/
validate-config.test.js
42 lines (37 loc) · 1.01 KB
/
validate-config.test.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
'use strict';
const fs = require('fs');
const { assert, refute } = require('@sinonjs/referee-sinon');
const { validateConfig } = require('./validate-config');
describe('mochify/lib/validate-config', () => {
it('returns an error when esm and bundle are given', () => {
assert.exception(() => {
validateConfig({
driver: 'puppeteer',
esm: true,
bundle: 'browserify',
spec: './test.js'
});
});
});
it('returns an error when bundle and a stream spec are given', () => {
assert.exception(() => {
validateConfig({
driver: 'puppeteer',
bundle: 'browserify',
spec: fs.createReadStream(__filename)
});
});
});
it('returns an error on an empty config', () => {
assert.exception(() => validateConfig({}));
});
it('returns null on a valid config', () => {
refute.exception(() => {
validateConfig({
bundle: 'browserify -t babelify',
spec: './test.js',
driver: 'puppeteer'
});
});
});
});