Tests fail with "Emit skipped" error when in Progam mode and "Emit skipped for language service" in LanguageService mode.
Works correctly with 23.2.1.
FAIL src/__tests__/Tree.test.tsx
● Test suite failed to run
TypeError: src/testing/mocks/loadershim.js: Emit skipped
at compileFn (node_modules/ts-jest/dist/compiler/program.js:137:23)
at Object.compile (node_modules/ts-jest/dist/compiler/instance.js:90:25)
at TsJestTransformer.process (node_modules/ts-jest/dist/ts-jest-transformer.js:94:41)
at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:446:35)
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:525:40)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:563:25)
src/testing/mocks/loadershim.js
global.___loader = {
enqueue: jest.fn(),
};
jest.config.js
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
transform: {},
testEnvironment: 'jsdom',
setupFiles: [
'<rootDir>/src/testing/mocks/loadershim.js',
'<rootDir>/src/testing/mocks/react-transition-group-mock.js',
],
setupFilesAfterEnv: ['<rootDir>/src/testing/setup.ts'],
roots: ['<rootDir>/src/'],
moduleNameMapper: {
'.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/testing/mocks/file-mock.js',
},
testPathIgnorePatterns: ['node_modules', '.cache'],
transformIgnorePatterns: ['node_modules/(?!(gatsby)/)'],
globals: {
__PATH_PREFIX__: '',
'ts-jest': {
babelConfig: true,
tsConfig: 'tsconfig.json',
isolatedModules: false,
compilerHost: true,
incremental: true,
},
},
};
tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"lib": ["esnext", "dom"],
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"allowJs": true,
"esModuleInterop": true,
"disableSizeLimit": true,
"jsx": "preserve"
},
"include": ["."],
"exclude": ["node_modules", "public", ".cache", "data", "static"]
}
deps:
"ts-jest": "25.3.1",
"typescript": "3.8.3"
"jest": "25.2.7",
"@babel/core": "7.9.0"
Tests fail with "Emit skipped" error when in Progam mode and "Emit skipped for language service" in LanguageService mode.
Works correctly with 23.2.1.
FAIL src/__tests__/Tree.test.tsx ● Test suite failed to run TypeError: src/testing/mocks/loadershim.js: Emit skipped at compileFn (node_modules/ts-jest/dist/compiler/program.js:137:23) at Object.compile (node_modules/ts-jest/dist/compiler/instance.js:90:25) at TsJestTransformer.process (node_modules/ts-jest/dist/ts-jest-transformer.js:94:41) at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:446:35) at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:525:40) at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:563:25)src/testing/mocks/loadershim.js
jest.config.js
tsconfig.json
{ "compilerOptions": { "baseUrl": ".", "lib": ["esnext", "dom"], "target": "esnext", "module": "esnext", "moduleResolution": "node", "noEmit": true, "strict": true, "allowSyntheticDefaultImports": true, "isolatedModules": true, "allowJs": true, "esModuleInterop": true, "disableSizeLimit": true, "jsx": "preserve" }, "include": ["."], "exclude": ["node_modules", "public", ".cache", "data", "static"] }deps: