diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cdee711f967..4013ef2dd32d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ - `[expect]` Throw useful error if `expect.extend` is called with invalid matchers ([#12488](https://github.com/facebook/jest/pull/12488)) - `[expect]` Fix `iterableEquality` ignores other properties ([#8359](https://github.com/facebook/jest/pull/8359)) - `[expect]` Fix print for the `closeTo` matcher ([#12626](https://github.com/facebook/jest/pull/12626)) +- `[jest-changed-files]` Improve `changedFilesWithAncestor` pattern for Mercurial SCM ([#12322](https://github.com/facebook/jest/pull/12322)) - `[jest-circus, @jest/types]` Disallow undefined value in `TestContext` type ([#12507](https://github.com/facebook/jest/pull/12507)) - `[jest-config]` Correctly detect CI environment and update snapshots accordingly ([#12378](https://github.com/facebook/jest/pull/12378)) - `[jest-config]` Pass `moduleTypes` to `ts-node` to enforce CJS when transpiling ([#12397](https://github.com/facebook/jest/pull/12397)) diff --git a/e2e/__tests__/jestChangedFiles.test.ts b/e2e/__tests__/jestChangedFiles.test.ts index ccb4b682ac53..c97f1dd53bbf 100644 --- a/e2e/__tests__/jestChangedFiles.test.ts +++ b/e2e/__tests__/jestChangedFiles.test.ts @@ -362,14 +362,6 @@ test('handles a bad revision for "changedSince", for git', async () => { }); testIfHg('gets changed files for hg', async () => { - if (process.env.CI) { - // Circle and Travis have very old version of hg (v2, and current - // version is v4.2) and its API changed since then and not compatible - // any more. Changing the SCM version on CIs is not trivial, so we'll just - // skip this test and run it only locally. - return; - } - // file1.txt is used to make a multi-line commit message // with `hg commit -l file1.txt`. // This is done to ensure that `changedFiles` only returns files diff --git a/packages/jest-changed-files/src/hg.ts b/packages/jest-changed-files/src/hg.ts index 02f1ea6099cd..c9fb11b5558a 100644 --- a/packages/jest-changed-files/src/hg.ts +++ b/packages/jest-changed-files/src/hg.ts @@ -18,7 +18,7 @@ const adapter: SCMAdapter = { const args = ['status', '-amnu']; if (options.withAncestor) { - args.push('--rev', 'min((!public() & ::.)+.)^'); + args.push('--rev', 'first(min(!public() & ::.)^+.^)'); } else if (options.changedSince) { args.push('--rev', `ancestor(., ${options.changedSince})`); } else if (options.lastCommit === true) {