forked from tape-testing/tape
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR introduces the --ignore-pattern flag as a shorthand for ignoring test files. The flag may be used together with --ignore; the input will be concatenated in that case. I figured this behavior would make the most sense, since users may want to ignore everything in .gitignore and some other files on top. Fixes tape-testing#586
- Loading branch information
1 parent
e9c9aba
commit 100f313
Showing
14 changed files
with
127 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
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,34 @@ | ||
'use strict'; | ||
|
||
var tap = require('tap'); | ||
var path = require('path'); | ||
var execFile = require('child_process').execFile; | ||
|
||
var tapeBin = path.join(process.cwd(), 'bin/tape'); | ||
|
||
tap.test('should allow ignore file together with --ignorePattern', function (tt) { | ||
tt.plan(1); | ||
var proc = execFile(tapeBin, ['--ignore', '.ignore', '--ignorePattern', 'fake_other_ignored_dir', '**/*.js'], { cwd: path.join(__dirname, 'ignorePattern') }); | ||
|
||
proc.on('exit', function (code) { | ||
tt.equals(code, 0); | ||
}); | ||
}); | ||
|
||
tap.test('should allow --ignorePattern without ignore file', function (tt) { | ||
tt.plan(1); | ||
var proc = execFile(tapeBin, ['--ignorePattern', 'fake_*', '**/*.js'], { cwd: path.join(__dirname, 'ignorePattern') }); | ||
|
||
proc.on('exit', function (code) { | ||
tt.equals(code, 0); | ||
}); | ||
}); | ||
|
||
tap.test('should fail if not ignoring', function (tt) { | ||
tt.plan(1); | ||
var proc = execFile(tapeBin, ['**/*.js'], { cwd: path.join(__dirname, 'ignorePattern') }); | ||
|
||
proc.on('exit', function (code) { | ||
tt.equals(code, 1); | ||
}); | ||
}); |
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 @@ | ||
fake_node_modules |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../../'); | ||
|
||
tape.test(function (t) { | ||
t.plan(1); | ||
t.fail('Should not print'); | ||
}); |
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../../'); | ||
|
||
tape.test(function (t) { | ||
t.fail('Should not print'); | ||
t.end(); | ||
}); |
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../'); | ||
|
||
tape.test(function (t) { | ||
t.pass('Should print'); | ||
t.end(); | ||
}); |
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../../'); | ||
|
||
tape.test(function (t) { | ||
t.plan(1); | ||
t.pass('test/stub1'); | ||
}); |
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../../'); | ||
|
||
tape.test(function (t) { | ||
t.pass('test/stub2'); | ||
t.end(); | ||
}); |
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../../../'); | ||
|
||
tape.test(function (t) { | ||
t.plan(1); | ||
t.pass('test/sub/stub1'); | ||
}); |
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../../../'); | ||
|
||
tape.test(function (t) { | ||
t.pass('test/sub/stub2'); | ||
t.end(); | ||
}); |
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,8 @@ | ||
'use strict'; | ||
|
||
var tape = require('../../'); | ||
|
||
tape.test(function (t) { | ||
t.pass('Should print'); | ||
t.end(); | ||
}); |