Skip to content

Instantly share code, notes, and snippets.

@biro456
Last active February 28, 2021 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biro456/40501e3bc024ba92cd3113a7e99d5ebe to your computer and use it in GitHub Desktop.
Save biro456/40501e3bc024ba92cd3113a7e99d5ebe to your computer and use it in GitHub Desktop.
ts-jest leaking @types/jest types
{
"testEnvironment": "node",
"testRegex": ".+\\.spec\\.ts$",
"transform": {
"^.+\\.ts$": "ts-jest"
},
"injectGlobals": false
}
{
"name": "sample",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "tsc --project tsconfig.build.json",
"test": "jest"
},
"devDependencies": {
"@jest/globals": "^26.6.0",
"jest": "^26.6.0",
"jest-circus": "^26.6.0",
"ts-jest": "^26.5.0",
"typescript": "~4.1.0"
}
}
import { Sample } from './sample';
describe('sample test', () => {
it('is instantiable', () => {
expect(new Sample()).toBeInstanceOf(Sample);
});
});
export class Sample { }
describe('sample', () => {
it('is instantiable', () => {
expect(new Sample()).toBeInstanceOf(Sample);
});
});
{
"extends": "./tsconfig.json",
"exclude": [
"node_modules/",
"**/*.spec.ts"
]
}
{
"compilerOptions": {
"target": "ES6",
"module": "CommonJS",
"lib": [
"ES6"
],
"noEmit": false,
"moduleResolution": "Node",
"declaration": true,
"sourceMap": true,
"strict": true,
"skipLibCheck": true
},
"exclude": [
"node_modules/"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment