let ts-jest transform JS and allow JS in tests

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2026-01-28 15:06:20 +01:00
parent 13d565c67f
commit 466f0611ff
3 changed files with 6 additions and 5 deletions

View File

@@ -38,7 +38,7 @@ module.exports = {
setupFiles: ['dotenv/config'], setupFiles: ['dotenv/config'],
testMatch: ['**/*.test.ts'], testMatch: ['**/*.test.ts'],
transform: { transform: {
'^.+\\.ts$': [ '^.+\\.[tj]s$': [
'ts-jest', 'ts-jest',
{ {
useESM: true, useESM: true,
@@ -46,7 +46,7 @@ module.exports = {
} }
] ]
}, },
transformIgnorePatterns: ['/node_modules/(?!(?:@octokit|universal-user-agent)/)'], transformIgnorePatterns: ['/node_modules/(?!(?:@octokit|universal-user-agent|before-after-hook)/)'],
moduleNameMapper: { moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1' '^(\\.{1,2}/.*)\\.js$': '$1'
}, },

View File

@@ -21,7 +21,7 @@ module.exports = {
testMatch: ['**/*.test.itg.ts'], testMatch: ['**/*.test.itg.ts'],
testTimeout: 1800000, // 30 minutes testTimeout: 1800000, // 30 minutes
transform: { transform: {
'^.+\\.ts$': [ '^.+\\.[tj]s$': [
'ts-jest', 'ts-jest',
{ {
useESM: true, useESM: true,
@@ -29,7 +29,7 @@ module.exports = {
} }
] ]
}, },
transformIgnorePatterns: ['/node_modules/(?!(?:@octokit|universal-user-agent)/)'], transformIgnorePatterns: ['/node_modules/(?!(?:@octokit|universal-user-agent|before-after-hook)/)'],
moduleNameMapper: { moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1' '^(\\.{1,2}/.*)\\.js$': '$1'
}, },

View File

@@ -2,7 +2,8 @@
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"noEmit": true "noEmit": true,
"allowJs": true
}, },
"include": [ "include": [
"src/**/*.ts", "src/**/*.ts",