Skip to content

Commit 72273cb

Browse files
committed
test(cli): add tests borrowed from mochajs#4407
1 parent 37deed2 commit 72273cb

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"require": ["foo", "bar"],
3+
"bail": true,
4+
"reporter": "dot",
5+
"slow": 60
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./modifiers.json"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "./base.json",
3+
"reporter": "html",
4+
"slow": 30
5+
}

test/integration/options.spec.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
var path = require('path');
4+
var loadOptions = require('../../lib/cli/options').loadOptions;
5+
6+
describe('options', function () {
7+
it('Should support extended options', function () {
8+
var configDir = path.join(
9+
__dirname,
10+
'fixtures',
11+
'config',
12+
'mocharc-extended'
13+
);
14+
var extended = loadOptions([
15+
'--config',
16+
path.join(configDir, 'extends.json')
17+
]);
18+
expect(extended.require, 'to equal', ['foo', 'bar']);
19+
expect(extended.bail, 'to equal', true);
20+
expect(extended.reporter, 'to equal', 'html');
21+
expect(extended.slow, 'to equal', 30);
22+
});
23+
});

0 commit comments

Comments
 (0)