Skip to content

Commit

Permalink
Improve test for mocha -f fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarel committed Jun 14, 2017
1 parent 406a0f0 commit 45143c8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/integration/options.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,17 @@ describe('options', function () {
});

describe('--help', function () {
it('works despite the presence of mocha.opts', function (done) {
var output = '';
try {
fs.mkdirSync(path.resolve(__dirname, 'test-env'));
fs.mkdirSync(path.resolve(__dirname, 'test-env/test'));
fs.writeFileSync(path.resolve(__dirname, 'test-env/test/mocha.opts'), 'foo');
var mochaLoc = path.resolve(__dirname, '../../bin/mocha');
output = '' + childProcess.execSync(mochaLoc + ' -h', {cwd: path.resolve(__dirname, 'test-env')});
} catch (e) {}
before(function () {
fs.mkdirSync(path.resolve(__dirname, 'test-env'));
fs.mkdirSync(path.resolve(__dirname, 'test-env/test'));
fs.writeFileSync(path.resolve(__dirname, 'test-env/test/mocha.opts'), 'foo');
});
it('works despite the presence of mocha.opts', function () {
var mochaLoc = path.resolve(__dirname, '../../bin/mocha');
var output = '' + childProcess.execSync(mochaLoc + ' -h', {cwd: path.resolve(__dirname, 'test-env')});
expect(output).to.contain('Usage:');
});
after(function () {
try {
fs.unlinkSync(path.resolve(__dirname, 'test-env/test/mocha.opts'));
} catch (e) {}
Expand All @@ -255,8 +257,6 @@ describe('options', function () {
try {
fs.rmdirSync(path.resolve(__dirname, 'test-env'));
} catch (e) {}
assert(output.indexOf('Usage:') >= 0);
done();
});
});
});

0 comments on commit 45143c8

Please sign in to comment.