Skip to content

Commit e930c70

Browse files
Tvrqvoisethymikee
authored andcommitted
Roll back micromatch (#6661)
## Summary As part of #6400, `micromatch` was updated. While `micromatch`'s CHANGELOG claims that this is safe, several regressions have been noted in cases where users relied upon invalid glob patterns. For example, these patterns would all match `src/foo/bar/baz.js`, but no longer do: - `src/**/*.{js}` - `src/**.js` - `src/**/*.{js|ts}` Fixes #6563 Fixes #6546 ## Test plan Unit tests were added which demonstrate the known cases.
1 parent fa92643 commit e930c70

File tree

7 files changed

+22
-5
lines changed

7 files changed

+22
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- `[jest-cli]` properly reprint resolver errors in watch mode ([#6407](https://github.com/facebook/jest/pull/6407))
77
- `[jest-cli]` Write configuration to stdout when the option was explicitly passed to Jest ([#6447](https://github.com/facebook/jest/pull/6447))
88
- `[jest-cli]` Fix regression on non-matching suites ([6657](https://github.com/facebook/jest/pull/6657))
9+
- `[jest-runtime]` Roll back `micromatch` version to prevent regression when matching files ([#6661](https://github.com/facebook/jest/pull/6661))
910

1011
## 23.3.0
1112

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"karma-mocha": "^1.3.0",
5353
"left-pad": "^1.1.1",
5454
"lerna": "2.11.0",
55-
"micromatch": "^3.1.10",
55+
"micromatch": "^2.3.11",
5656
"mkdirp": "^0.5.1",
5757
"mocha": "^5.0.1",
5858
"mock-fs": "^4.4.1",

packages/jest-cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"jest-validate": "^23.3.0",
3131
"jest-watcher": "^23.2.0",
3232
"jest-worker": "^23.2.0",
33-
"micromatch": "^3.1.10",
33+
"micromatch": "^2.3.11",
3434
"node-notifier": "^5.2.1",
3535
"prompts": "^0.1.9",
3636
"realpath-native": "^1.0.0",

packages/jest-haste-map/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"jest-docblock": "^23.2.0",
1414
"jest-serializer": "^23.0.1",
1515
"jest-worker": "^23.2.0",
16-
"micromatch": "^3.1.10",
16+
"micromatch": "^2.3.11",
1717
"sane": "^2.0.0"
1818
}
1919
}

packages/jest-message-util/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dependencies": {
1111
"@babel/code-frame": "^7.0.0-beta.35",
1212
"chalk": "^2.0.1",
13-
"micromatch": "^3.1.10",
13+
"micromatch": "^2.3.11",
1414
"slash": "^1.0.0",
1515
"stack-utils": "^1.0.1"
1616
}

packages/jest-runtime/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"jest-snapshot": "^23.3.0",
2424
"jest-util": "^23.3.0",
2525
"jest-validate": "^23.3.0",
26-
"micromatch": "^3.1.10",
26+
"micromatch": "^2.3.11",
2727
"realpath-native": "^1.0.0",
2828
"slash": "^1.0.0",
2929
"strip-bom": "3.0.0",

packages/jest-runtime/src/__tests__/should_instrument.test.js

+16
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,22 @@ describe('should_instrument', () => {
6262
);
6363
});
6464

65+
it('should should match invalid globs, to be removed in the next major', () => {
66+
const testSingleCollectCoverageFrom = pattern =>
67+
testShouldInstrument(
68+
'do/collect/coverage.js',
69+
{
70+
collectCoverage: true,
71+
collectCoverageFrom: [pattern],
72+
},
73+
defaultConfig,
74+
);
75+
76+
testSingleCollectCoverageFrom('**/do/**/*.{js}');
77+
testSingleCollectCoverageFrom('**/do/**/*.{js|ts}');
78+
testSingleCollectCoverageFrom('**/do/**.js');
79+
});
80+
6581
it('should return true if the file is not in coveragePathIgnorePatterns', () => {
6682
testShouldInstrument('do/collect/coverage.js', defaultOptions, {
6783
coveragePathIgnorePatterns: ['dont'],

0 commit comments

Comments
 (0)