Skip to content

Commit

Permalink
🔧(jest) Migrate jest to esm (#5167)
Browse files Browse the repository at this point in the history
**Description** first opened as #4605

<!-- Please provide a short description and potentially linked issues
justifying the need for this PR -->

Updating test chain to esm.

<!-- * Your PR is fixing a bug or regression? Check for existing issues
related to this bug and link them -->
<!-- * Your PR is adding a new feature? Make sure there is a related
issue or discussion attached to it -->

<!-- You can provide any additional context to help into understanding
what's this PR is attempting to solve: reproduction of a bug, code
snippets... -->

**Checklist** — _Don't delete this checklist and make sure you do the
following before opening the PR_

- [x] The name of my PR follows [gitmoji](https://gitmoji.dev/)
specification
- [x] My PR references one of several related issues (if any)
- [x] New features or breaking changes must come with an associated
Issue or Discussion
- [x] My PR does not add any new dependency without an associated Issue
or Discussion
- [x] My PR includes bumps details, please run `yarn bump` and flag the
impacts properly
- [x] My PR adds relevant tests and they would have failed without my PR
(when applicable)

<!-- More about contributing at
https://github.com/dubzzz/fast-check/blob/main/CONTRIBUTING.md -->

**Advanced**

<!-- How to fill the advanced section is detailed below! -->

- [x] Category: ✅ Add or update tests
- [x] Impacts: Change test change to be ESM first

<!-- [Category] Please use one of the categories below, it will help us
into better understanding the urgency of the PR -->
<!-- * ✨ Introduce new features -->
<!-- * 📝 Add or update documentation -->
<!-- * ✅ Add or update tests -->
<!-- * 🐛 Fix a bug -->
<!-- * 🏷️ Add or update types -->
<!-- * ⚡️ Improve performance -->
<!-- * _Other(s):_ ... -->

<!-- [Impacts] Please provide a comma separated list of the potential
impacts that might be introduced by this change -->
<!-- * Generated values: Can your change impact any of the existing
generators in terms of generated values, if so which ones? when? -->
<!-- * Shrink values: Can your change impact any of the existing
generators in terms of shrink values, if so which ones? when? -->
<!-- * Performance: Can it require some typings changes on user side?
Please give more details -->
<!-- * Typings: Is there a potential performance impact? In which cases?
-->
  • Loading branch information
dubzzz authored Jul 26, 2024
1 parent 0efddc2 commit 1581b13
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/jest/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
presets: ['@babel/preset-typescript'],
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
export default {
testPathIgnorePatterns: ['/generated-tests/'],
extensionsToTreatAsEsm: ['.ts'],
};
1 change: 0 additions & 1 deletion packages/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
},
"devDependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@babel/preset-typescript": "^7.24.7",
"@fast-check/worker": "workspace:*",
"@jest/expect": "^29.7.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/jest/test/jest-fast-check.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import * as path from 'path';
import * as url from 'url';
import { promises as fs } from 'fs';
import { promisify } from 'util';
import { execFile as _execFile } from 'child_process';
import { jest } from '@jest/globals';

const execFile = promisify(_execFile);
// @ts-expect-error --module must be higher
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));

import type _fc from 'fast-check';
import type { test as _test, it as _it } from '@fast-check/jest';
Expand Down
9 changes: 4 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/preset-env@npm:^7.11.0, @babel/preset-env@npm:^7.20.2, @babel/preset-env@npm:^7.22.9, @babel/preset-env@npm:^7.23.3, @babel/preset-env@npm:^7.24.8":
"@babel/preset-env@npm:^7.11.0, @babel/preset-env@npm:^7.20.2, @babel/preset-env@npm:^7.22.9, @babel/preset-env@npm:^7.23.3":
version: 7.24.8
resolution: "@babel/preset-env@npm:7.24.8"
dependencies:
Expand Down Expand Up @@ -1831,13 +1831,13 @@ __metadata:
linkType: hard

"@codemirror/view@npm:^6.0.0, @codemirror/view@npm:^6.17.0, @codemirror/view@npm:^6.23.0, @codemirror/view@npm:^6.27.0, @codemirror/view@npm:^6.7.1":
version: 6.28.6
resolution: "@codemirror/view@npm:6.28.6"
version: 6.28.4
resolution: "@codemirror/view@npm:6.28.4"
dependencies:
"@codemirror/state": "npm:^6.4.0"
style-mod: "npm:^4.1.0"
w3c-keyname: "npm:^2.2.4"
checksum: 10c0/aaf0cd3959d846bb70cb760832c6dd2b74531d7d45d79b7bc10360ab8b0543234db3c04f6e56cee2d99b33057fc229f977e0f0f0c52be4cbd855b779d86e5a68
checksum: 10c0/a9b34fd6b34f0cc44b5d2b7c3eba6550ee6aab2dafe1339ed04fa53d7ac67c7fdb69fc9c5618b6dec5136c68e7695f0199066d262fb483873bffae7ff3f4bcc4
languageName: node
linkType: hard

Expand Down Expand Up @@ -2798,7 +2798,6 @@ __metadata:
resolution: "@fast-check/jest@workspace:packages/jest"
dependencies:
"@babel/core": "npm:^7.24.9"
"@babel/preset-env": "npm:^7.24.8"
"@babel/preset-typescript": "npm:^7.24.7"
"@fast-check/worker": "workspace:*"
"@jest/expect": "npm:^29.7.0"
Expand Down

0 comments on commit 1581b13

Please sign in to comment.