Skip to content

Commit

Permalink
test(cli): add tests borrowed from mochajs#4407
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Apr 24, 2023
1 parent 37deed2 commit 72273cb
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/integration/fixtures/config/mocharc-extended/base.json
@@ -0,0 +1,6 @@
{
"require": ["foo", "bar"],
"bail": true,
"reporter": "dot",
"slow": 60
}
@@ -0,0 +1,3 @@
{
"extends": "./modifiers.json"
}
@@ -0,0 +1,5 @@
{
"extends": "./base.json",
"reporter": "html",
"slow": 30
}
23 changes: 23 additions & 0 deletions test/integration/options.spec.js
@@ -0,0 +1,23 @@
'use strict';

var path = require('path');
var loadOptions = require('../../lib/cli/options').loadOptions;

describe('options', function () {
it('Should support extended options', function () {
var configDir = path.join(
__dirname,
'fixtures',
'config',
'mocharc-extended'
);
var extended = loadOptions([
'--config',
path.join(configDir, 'extends.json')
]);
expect(extended.require, 'to equal', ['foo', 'bar']);
expect(extended.bail, 'to equal', true);
expect(extended.reporter, 'to equal', 'html');
expect(extended.slow, 'to equal', 30);
});
});

0 comments on commit 72273cb

Please sign in to comment.