Skip to content

Commit

Permalink
Add tests for double-star behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottFreeCode committed Jul 9, 2017
1 parent 3fa9c79 commit 91f703e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/integration/fixtures/glob/nested/glob.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

describe('globbing test', function () {
it('should find this test', function () {
// see test/integration/glob.spec.js for details
});
});
21 changes: 21 additions & 0 deletions test/integration/glob.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@ describe('globbing', function () {
expect(results.stderr).to.contain('Could not find any test files matching pattern');
}, done);
});

describe('double-starred', function () {
it('should find the tests on multiple levels', function (done) {
testGlob.shouldSucceed('"./**/*.js"', function (results) {
expect(results.stdout).to.contain('["end",{"suites":2,"tests":2,"passes":2,"pending":0,"failures":0,');
}, done);
});

it('should not find a non-matching pattern', function (done) {
testGlob.shouldFail('"./**/*-none.js"', function (results) {
expect(results.stderr).to.contain('Could not find any test files matching pattern');
}, done);
});

it('should handle both matching and non-matching patterns in the same command', function (done) {
testGlob.shouldSucceed('"./**/*.js" "./**/*-none.js"', function (results) {
expect(results.stdout).to.contain('["end",{"suites":2,"tests":2,"passes":2,"pending":0,"failures":0,');
expect(results.stderr).to.contain('Could not find any test files matching pattern');
}, done);
});
});
});
});

Expand Down

0 comments on commit 91f703e

Please sign in to comment.