-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for grep option programmatic (#188)
* - add test for grep option programmatic * Update according comments to pull request: - change body of test - rename test name
- Loading branch information
Showing
4 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Check that --grep flag run tests by string pattern 'grep' | ||
- index.js check that --grep flag run tests by string pattern 'grep' | ||
- indexProgrammatic.js check that --grep flag run tests by string pattern 'grep' with programmatic using mocha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const MochaParallelTests = require('../../dist/main/mocha').default; | ||
const { setProcessExitListeners } = require('../../dist/util'); | ||
const SilentReporter = require('../util/silent-reporter'); | ||
|
||
setProcessExitListeners(); | ||
|
||
const mocha = new MochaParallelTests; | ||
mocha.addFile(`${__dirname}/tests/test.js`) | ||
.addFile(`${__dirname}/tests/test1.js`) | ||
.timeout(10000) | ||
.grep('grep') | ||
.reporter(SilentReporter); | ||
|
||
mocha.run().on('end', function () { | ||
assert.strictEqual(this.stats.passes, 3); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters