Skip to content

Commit

Permalink
fix(jest-changed-files): improve changedFilesWithAncestor command p…
Browse files Browse the repository at this point in the history
…attern for Mercurial SCM (#12322)
  • Loading branch information
mrazauskas authored Apr 21, 2022
1 parent f60f84e commit 49cc5d2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 0 additions & 8 deletions e2e/__tests__/jestChangedFiles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-changed-files/src/hg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 49cc5d2

Please sign in to comment.