Skip to content

Commit aa6e636

Browse files
Merge pull request #9 from nicolo-ribaudo/babel-8
Test Babel 8 compatibility
2 parents 45536ee + a66c585 commit aa6e636

6 files changed

Lines changed: 1225 additions & 23 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ jobs:
4444
- run: pnpm i --frozen-lockfile
4545
- run: pnpm test
4646

47+
test-babel-8:
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 10
50+
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: pnpm/action-setup@v4
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version: 22.x
57+
cache: pnpm
58+
- run: pnpm i
59+
- run: pnpm i @babel/core@^8.0.0-0 @babel/plugin-syntax-decorators@^8.0.0-0 @babel/plugin-transform-typescript@^8.0.0-0 --save
60+
- run: pnpm test
61+
4762
floating:
4863
runs-on: ubuntu-latest
4964
timeout-minutes: 10

jest.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2-
module.exports = {
2+
3+
const nativeESM = !!process.features.typescript;
4+
5+
const config = {
36
preset: 'ts-jest/presets/default-esm',
47
testEnvironment: 'node',
58
moduleDirectories: ['node_modules', 'src'],
@@ -9,6 +12,13 @@ module.exports = {
912
diagnostics: {
1013
ignoreCodes: [151001],
1114
},
15+
useESM: nativeESM,
1216
},
1317
},
1418
};
19+
20+
if (nativeESM) {
21+
config.runner = 'jest-light-runner';
22+
}
23+
24+
module.exports = config;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"eslint-config-prettier": "^8.3.0",
5555
"eslint-plugin-prettier": "^4.0.0",
5656
"jest": "^27.4.7",
57+
"jest-light-runner": "^0.7.10",
5758
"release-plan": "^0.9.0",
5859
"rimraf": "^3.0.2",
5960
"ts-jest": "^27.1.3",

0 commit comments

Comments
 (0)