Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ee3bf08

Browse files
zsolskovhus
authored andcommittedApr 29, 2017
testMatch should find tests in .folders (jestjs#3006)
* testMatch should find tests in .folders * dont depend on order of paths in tests
1 parent b7d14ad commit ee3bf08

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed
 

‎packages/jest-cli/src/SearchSource.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const globsToMatcher = (globs: ?Array<Glob>) => {
7777
return () => true;
7878
}
7979

80-
const matchers = globs.map(each => micromatch.matcher(each));
80+
const matchers = globs.map(each => micromatch.matcher(each, {dot: true}));
8181
return (path: Path) => matchers.some(each => each(path));
8282
};
8383

‎packages/jest-cli/src/__tests__/SearchSource-test.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ describe('SearchSource', () => {
108108
return findMatchingTests(config).then(data => {
109109
const relPaths = data.paths.map(absPath => (
110110
path.relative(rootDir, absPath)
111-
));
111+
)).sort();
112112
expect(relPaths).toEqual([
113+
path.normalize('.hiddenFolder/not-really-a-test.txt'),
113114
path.normalize('__testtests__/not-really-a-test.txt'),
114-
]);
115+
].sort());
115116
});
116117
});
117118

@@ -126,10 +127,11 @@ describe('SearchSource', () => {
126127
return findMatchingTests(config).then(data => {
127128
const relPaths = data.paths.map(absPath => (
128129
path.relative(rootDir, absPath)
129-
));
130+
)).sort();
130131
expect(relPaths).toEqual([
132+
path.normalize('.hiddenFolder/not-really-a-test.txt'),
131133
path.normalize('__testtests__/not-really-a-test.txt'),
132-
]);
134+
].sort());
133135
});
134136
});
135137

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// not-really-a-test.txt
2+
3+
require('../module.txt');

0 commit comments

Comments
 (0)
Please sign in to comment.