Skip to content

Commit

Permalink
feat: add additional patterns to default excludes (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux authored and bcoe committed Feb 13, 2018
1 parent 6cac849 commit 4cedf63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/test-exclude/index.js
Expand Up @@ -125,9 +125,10 @@ var exportFunc = function (opts) {

exportFunc.defaultExclude = [
'coverage/**',
'packages/*/test/**',
'test/**',
'test{,-*}.js',
'**/*.test.js',
'**/*{.,-}test.js',
'**/__tests__/**',
'**/node_modules/**'
]
Expand Down
9 changes: 8 additions & 1 deletion packages/test-exclude/test/test-exclude.js
Expand Up @@ -115,9 +115,10 @@ describe('testExclude', function () {
it('exports defaultExclude', function () {
exclude.defaultExclude.should.deep.equal([
'coverage/**',
'packages/*/test/**',
'test/**',
'test{,-*}.js',
'**/*.test.js',
'**/*{.,-}test.js',
'**/__tests__/**',
'**/node_modules/**'
])
Expand Down Expand Up @@ -167,6 +168,9 @@ describe('testExclude', function () {

e.shouldInstrument('test.js').should.equal(false)
e.shouldInstrument('src/app.test.js').should.equal(false)
e.shouldInstrument('src/app-test.js').should.equal(false)

e.shouldInstrument('packages/package-name/test/test-utils.js').should.equal(false)

e.shouldInstrument('bar/baz.js').should.equal(true)
e.shouldInstrument('bad/file.js').should.equal(true)
Expand Down Expand Up @@ -206,6 +210,9 @@ describe('testExclude', function () {

e.shouldInstrument('test.js').should.equal(false)
e.shouldInstrument('src/app.test.js').should.equal(false)
e.shouldInstrument('src/app-test.js').should.equal(false)

e.shouldInstrument('packages/package-name/test/test-utils.js').should.equal(false)

e.shouldInstrument('bar/baz.js').should.equal(true)
e.shouldInstrument('bad/file.js').should.equal(true)
Expand Down

0 comments on commit 4cedf63

Please sign in to comment.