Skip to content

Commit 91f703e

Browse files
committed
Add tests for double-star behavior
1 parent 3fa9c79 commit 91f703e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Diff for: test/integration/fixtures/glob/nested/glob.spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
describe('globbing test', function () {
4+
it('should find this test', function () {
5+
// see test/integration/glob.spec.js for details
6+
});
7+
});

Diff for: test/integration/glob.spec.js

+21
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ describe('globbing', function () {
4747
expect(results.stderr).to.contain('Could not find any test files matching pattern');
4848
}, done);
4949
});
50+
51+
describe('double-starred', function () {
52+
it('should find the tests on multiple levels', function (done) {
53+
testGlob.shouldSucceed('"./**/*.js"', function (results) {
54+
expect(results.stdout).to.contain('["end",{"suites":2,"tests":2,"passes":2,"pending":0,"failures":0,');
55+
}, done);
56+
});
57+
58+
it('should not find a non-matching pattern', function (done) {
59+
testGlob.shouldFail('"./**/*-none.js"', function (results) {
60+
expect(results.stderr).to.contain('Could not find any test files matching pattern');
61+
}, done);
62+
});
63+
64+
it('should handle both matching and non-matching patterns in the same command', function (done) {
65+
testGlob.shouldSucceed('"./**/*.js" "./**/*-none.js"', function (results) {
66+
expect(results.stdout).to.contain('["end",{"suites":2,"tests":2,"passes":2,"pending":0,"failures":0,');
67+
expect(results.stderr).to.contain('Could not find any test files matching pattern');
68+
}, done);
69+
});
70+
});
5071
});
5172
});
5273

0 commit comments

Comments
 (0)