-
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.
Browse files
Browse the repository at this point in the history
* - add support option grep - add test * - add support grep option - add test for new option * add test in list * Add grep flag to runner and mocha ts * back tests * final fixes to make working grep according to pull request comments
- Loading branch information
Showing
10 changed files
with
85 additions
and
0 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
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 @@ | ||
export { applyGrepPattern as default } from '../../util'; |
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
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 @@ | ||
Check that --grep flag run tests by string pattern 'grep' |
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,27 @@ | ||
#!/usr/bin/env node | ||
|
||
var assert = require('assert'); | ||
var path = require('path'); | ||
var exec = require('child_process').exec; | ||
var libExecutable = path.resolve(__dirname, '../../dist/bin/cli.js'); | ||
|
||
exec(libExecutable + ' -R json --grep grep test/grep/tests', { | ||
cwd: path.resolve(__dirname, '../../') | ||
}, function (err, stderr) { | ||
if (err) { | ||
console.error(err); | ||
process.exit(1); | ||
} | ||
|
||
var jsonReporterOutput = stderr.toString(); | ||
|
||
try { | ||
jsonReporterOutput = JSON.parse(jsonReporterOutput); | ||
} catch (ex) { | ||
console.error('Native JSON reporter output is not valid JSON: ' + jsonReporterOutput); | ||
process.exit(1); | ||
} | ||
|
||
assert.strictEqual(jsonReporterOutput.stats.passes, 3, 'Tests number is wrong. Expected 3. Actual: ' | ||
+ jsonReporterOutput.stats.passes); | ||
}); |
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,19 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
|
||
describe('tests', () => { | ||
it('should be run 1. grep', () => { | ||
assert.ok(true); | ||
}); | ||
|
||
it('should be skipped', () => { | ||
assert.ok(true); | ||
}); | ||
}); | ||
|
||
describe('tests should be run. grep', () => { | ||
it('should be run 2', () => { | ||
assert.ok(true); | ||
}); | ||
}); |
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,14 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
|
||
describe('tests file 2', () => { | ||
it('should be run 3. grep', () => { | ||
assert.ok(true); | ||
}); | ||
|
||
it('should be skipped', () => { | ||
assert.ok(true); | ||
}); | ||
}); | ||
|
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