mirror of
https://github.com/actions/setup-node.git
synced 2025-12-18 06:17:35 +00:00
feat: migrate to ESM and update Jest configuration
- Added package.json in dist/setup to specify module type as ESM. - Updated jest.config.js to support ESM with ts-jest and added moduleNameMapper for .js extensions. - Created jest.setup.js to ensure Jest globals are available in ESM mode. - Modified test script in package.json to use node with experimental VM modules for Jest. - Updated imports in various distribution files to include .js extensions for ESM compatibility. - Adjusted tsconfig.json to exclude __tests__ directory and maintain ESM settings. - Updated package-lock.json to include new dependencies and their versions.
This commit is contained in:
parent
100690a6a6
commit
81b484e462
28 changed files with 3641 additions and 5337 deletions
|
|
@ -5,14 +5,21 @@ export default {
|
|||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
extensionsToTreatAsEsm: ['.ts'],
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
useESM: true
|
||||
}
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
'^.+\\.ts$': ['ts-jest', {
|
||||
useESM: true,
|
||||
tsconfig: {
|
||||
module: 'es2022',
|
||||
target: 'es2022'
|
||||
}
|
||||
}]
|
||||
},
|
||||
preset: 'ts-jest/presets/default-esm',
|
||||
moduleNameMapper: {
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1'
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
'node_modules/(?!(node-fetch|fetch-blob|formdata-polyfill|data-uri-to-buffer)/)'
|
||||
],
|
||||
verbose: true
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue