Skip to content

Commit

Permalink
use {dot: true} for all micromatches
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Jul 10, 2018
1 parent da8586a commit 592d50b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/jest-cli/src/run_jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export default (async function runJest({
!micromatch(
[path.relative(globalConfig.rootDir, filename)],
globalConfig.collectCoverageFrom,
{dot: true},
).length
) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-haste-map/src/haste_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class HasteFS {
const files = new Set();
for (const file in this._files) {
const filePath = root ? path.relative(root, file) : file;
if (micromatch([filePath], globs).length) {
if (micromatch([filePath], globs, {dot: true}).length) {
files.add(file);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-message-util/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const formatPaths = (config: StackTraceConfig, relativeTestPath, line) => {
if (
(config.testMatch &&
config.testMatch.length &&
micromatch(filePath, config.testMatch)) ||
micromatch(filePath, config.testMatch, {dot: true})) ||
filePath === relativeTestPath
) {
filePath = chalk.reset.cyan(filePath);
Expand Down
5 changes: 3 additions & 2 deletions packages/jest-runtime/src/should_instrument.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function shouldInstrument(
if (
config.forceCoverageMatch &&
config.forceCoverageMatch.length &&
micromatch.any(filename, config.forceCoverageMatch)
micromatch.any(filename, config.forceCoverageMatch, {dot: true})
) {
return true;
}
Expand All @@ -42,7 +42,7 @@ export default function shouldInstrument(
if (
config.testMatch &&
config.testMatch.length &&
micromatch.any(filename, config.testMatch)
micromatch.any(filename, config.testMatch, {dot: true})
) {
return false;
}
Expand All @@ -63,6 +63,7 @@ export default function shouldInstrument(
!micromatch(
[path.relative(config.rootDir, filename)],
options.collectCoverageFrom,
{dot: true},
).length
) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ function buildFile(file, silent) {
const destPath = getBuildPath(file, BUILD_DIR);

mkdirp.sync(path.dirname(destPath));
if (micromatch.isMatch(file, IGNORE_PATTERN)) {
if (micromatch.isMatch(file, IGNORE_PATTERN, {dot: true})) {
silent ||
process.stdout.write(
chalk.dim(' \u2022 ') +
path.relative(PACKAGES_DIR, file) +
' (ignore)\n'
);
} else if (!micromatch.isMatch(file, JS_FILES_PATTERN)) {
} else if (!micromatch.isMatch(file, JS_FILES_PATTERN, {dot: true})) {
fs.createReadStream(file).pipe(fs.createWriteStream(destPath));
silent ||
process.stdout.write(
Expand Down

0 comments on commit 592d50b

Please sign in to comment.