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

fix(jest-changed-files): improve changedFilesWithAncestor command pattern for Mercurial SCM #12322

Merged
merged 15 commits into from
Apr 21, 2022
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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