Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to micromatch 3 #6650

Merged
merged 38 commits into from
Jan 18, 2019
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ee217ea
fix: test not found on windows with micromatch 3
aldarund Jul 6, 2018
069fc76
fix: test not found on windows with micromatch 3
aldarund Jul 6, 2018
c60f69e
allow some special char in filenames to be escaped
aldarund Jul 6, 2018
9568fa4
enable search_source test on windows except last test
aldarund Jul 7, 2018
04fb782
fix: test not found on windows with micromatch 3
aldarund Jul 6, 2018
2e4ab1a
fix: test not found on windows with micromatch 3
aldarund Jul 6, 2018
5322b77
allow some special char in filenames to be escaped
aldarund Jul 6, 2018
d0334fe
enable search_source test on windows except last test
aldarund Jul 7, 2018
7be09c3
add changelog
aldarund Jul 7, 2018
12cbd03
Merge remote-tracking branch 'origin/fix-win-find-tests' into fix-win…
aldarund Jul 7, 2018
aa7c041
fix: test not found on windows with micromatch 3
aldarund Jul 6, 2018
b1714c8
fix: test not found on windows with micromatch 3
aldarund Jul 6, 2018
250238b
allow some special char in filenames to be escaped
aldarund Jul 6, 2018
66d630d
enable search_source test on windows except last test
aldarund Jul 7, 2018
1a4c4ca
add changelog
aldarund Jul 7, 2018
b45e186
Merge remote-tracking branch 'origin/fix-win-find-tests' into fix-win…
aldarund Jul 7, 2018
cd37d8f
Merge branch 'master' into fix-win-find-tests
thymikee Jul 8, 2018
d20d649
Merge branch 'master' into fix-win-find-tests
thymikee Jul 8, 2018
f0c37f7
Merge remote-tracking branch 'origin/fix-win-find-tests' into fix-win…
aldarund Aug 15, 2018
9bedc90
# Conflicts:
aldarund Aug 15, 2018
c22eb3b
Merge branch 'master' into fix-win-find-tests
aldarund Aug 15, 2018
b2bb804
lint
aldarund Aug 15, 2018
52b3d87
Merge branch 'master' into fix-win-find-tests
thymikee Oct 18, 2018
394bc10
Merge branch 'master' into fix-win-find-tests
SimenB Jan 13, 2019
57d4742
chore: upgrade micromatch to v3
SimenB Jan 13, 2019
64bc0f1
Merge branch 'master' into fix-win-find-tests
SimenB Jan 13, 2019
766ff05
fix browser build
SimenB Jan 13, 2019
9379b31
remove test assrting wrong behavior
SimenB Jan 13, 2019
0bf7d9a
fix lint
SimenB Jan 13, 2019
7096a98
normalize globs
SimenB Jan 13, 2019
2e519a9
use micromatch.some and drop extra arrays
SimenB Jan 13, 2019
2fc18c1
is slash enough?
SimenB Jan 13, 2019
cf3e726
what about this?
SimenB Jan 13, 2019
99a7b28
move helper to jest-util, fix hastefs
SimenB Jan 14, 2019
201e21b
must replace for glob
SimenB Jan 14, 2019
cfe15b6
add missing dep to haste-map
SimenB Jan 14, 2019
2de34f6
fix test
SimenB Jan 14, 2019
9e28572
Merge branch 'master' into fix-win-find-tests
SimenB Jan 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@

- `[*]` [**BREAKING**] Require Node.js 6+ for all packages ([#7258](https://github.com/facebook/jest/pull/7258))
- `[jest-util]` [**BREAKING**] Remove long-deprecated globals for fake timers ([#7285](https://github.com/facebook/jest/pull/7285))
- `[*]` [**BREAKING**] Upgrade to Micromatch 3 ([#6650](https://github.com/facebook/jest/pull/6650))
- `[docs]` Fix message property in custom matcher example to return a function instead of a constant. ([#7426](https://github.com/facebook/jest/pull/7426))
- `[jest-circus]` Standardize file naming in `jest-circus` ([#7301](https://github.com/facebook/jest/pull/7301))
- `[docs]` Add synchronous test.each setup ([#7150](https://github.com/facebook/jest/pull/7150))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"karma-mocha": "^1.3.0",
"left-pad": "^1.1.1",
"lerna": "3.4.0",
"micromatch": "^2.3.11",
"micromatch": "^3.1.10",
"mkdirp": "^0.5.1",
"mocha": "^5.0.1",
"mock-fs": "^4.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"jest-validate": "^23.6.0",
"jest-watcher": "^23.4.0",
"jest-worker": "^23.2.0",
"micromatch": "^2.3.11",
"micromatch": "^3.1.10",
"node-notifier": "^5.2.1",
"prompts": "^1.1.0",
"realpath-native": "^1.0.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-cli/src/SearchSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ const globsToMatcher = (globs: ?Array<Glob>) => {
return () => true;
}

return path => micromatch([path], globs, {dot: true}).length > 0;
return path =>
micromatch([path.replace(/\\(?![{}()+?.^$])/g, '/')], globs, {dot: true})
.length > 0;
};

const regexToMatcher = (testRegex: Array<string>) => {
Expand Down
33 changes: 17 additions & 16 deletions packages/jest-cli/src/__tests__/SearchSource.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import path from 'path';
import {skipSuiteOnWindows} from '../../../../scripts/ConditionalTest';

jest.setTimeout(15000);

const rootDir = path.resolve(__dirname, 'test_root');
const testRegex = path.sep + '__testtests__' + path.sep;
const testMatch = ['**/__testtests__/**/*'];
Expand All @@ -23,8 +24,6 @@ let findMatchingTests;
let normalize;

describe('SearchSource', () => {
skipSuiteOnWindows();

const name = 'SearchSource';
let Runtime;
let SearchSource;
Expand Down Expand Up @@ -481,22 +480,24 @@ describe('SearchSource', () => {
});

it('does not mistake roots folders with prefix names', async () => {
const config = normalize(
{
name,
rootDir: '.',
roots: ['/foo/bar/prefix'],
},
{},
).options;
if (process.platform !== 'win32') {
const config = normalize(
{
name,
rootDir: '.',
roots: ['/foo/bar/prefix'],
},
{},
).options;

searchSource = new SearchSource(
await Runtime.createContext(config, {maxWorkers}),
);
searchSource = new SearchSource(
await Runtime.createContext(config, {maxWorkers}),
);

const input = ['/foo/bar/prefix-suffix/__tests__/my-test.test.js'];
const data = searchSource.findTestsByPaths(input);
expect(data.tests).toEqual([]);
const input = ['/foo/bar/prefix-suffix/__tests__/my-test.test.js'];
const data = searchSource.findTestsByPaths(input);
expect(data.tests).toEqual([]);
}
});
});
});
2 changes: 1 addition & 1 deletion packages/jest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"jest-resolve": "^23.6.0",
"jest-util": "^23.4.0",
"jest-validate": "^23.6.0",
"micromatch": "^2.3.11",
"micromatch": "^3.1.10",
"pretty-format": "^23.6.0",
"realpath-native": "^1.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-haste-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"invariant": "^2.2.4",
"jest-serializer": "^23.0.1",
"jest-worker": "^23.2.0",
"micromatch": "^2.3.11",
"micromatch": "^3.1.10",
"sane": "^3.0.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-message-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@babel/code-frame": "^7.0.0",
"chalk": "^2.0.1",
"micromatch": "^2.3.11",
"micromatch": "^3.1.10",
"slash": "^2.0.0",
"stack-utils": "^1.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"jest-snapshot": "^23.6.0",
"jest-util": "^23.4.0",
"jest-validate": "^23.6.0",
"micromatch": "^2.3.11",
"micromatch": "^3.1.10",
"realpath-native": "^1.0.0",
"slash": "^2.0.0",
"strip-bom": "3.0.0",
Expand Down