Skip to content

Commit

Permalink
feat: ignore files under test**s** directories by default (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn authored and coreyfarrell committed Jun 11, 2019
1 parent c4e8b8e commit 8ad5fd2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/test-exclude/default-exclude.js
Expand Up @@ -4,8 +4,8 @@ const devConfigs = ['ava', 'babel', 'jest', 'nyc', 'rollup', 'webpack'];

module.exports = [
'coverage/**',
'packages/*/test/**',
'test/**',
'packages/*/test{,s}/**',
'test{,s}/**',
'test{,-*}.{js,cjs,mjs,ts}',
'**/*{.,-}test.{js,cjs,mjs,ts}',
'**/__tests__/**',
Expand Down
14 changes: 12 additions & 2 deletions packages/test-exclude/test/test-exclude.js
Expand Up @@ -43,6 +43,16 @@ describe('testExclude', () => {
.should.equal(false);
});

it('ignores ./test and ./tests', () => {
exclude()
.shouldInstrument('./test/index.js')
.should.equal(false);

exclude()
.shouldInstrument('./tests/index.js')
.should.equal(false);
});

it('matches files in root with **/', () => {
exclude()
.shouldInstrument('__tests__/**')
Expand Down Expand Up @@ -227,8 +237,8 @@ describe('testExclude', () => {
it('exports defaultExclude', () => {
exclude.defaultExclude.should.deep.equal([
'coverage/**',
'packages/*/test/**',
'test/**',
'packages/*/test{,s}/**',
'test{,s}/**',
'test{,-*}.{js,cjs,mjs,ts}',
'**/*{.,-}test.{js,cjs,mjs,ts}',
'**/__tests__/**',
Expand Down

0 comments on commit 8ad5fd2

Please sign in to comment.