mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
fix(jest): fix ProjectConfig.transform type
This commit is contained in:
Vendored
+4
-1
@@ -13,6 +13,7 @@
|
||||
// Ahn <https://github.com/AhnpGit>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Bradley Ayers <https://github.com/bradleyayers>
|
||||
// Martin Hochel <https://github.com/hotell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -795,6 +796,7 @@ declare namespace jest {
|
||||
|
||||
type SnapshotUpdateState = 'all' | 'new' | 'none';
|
||||
|
||||
// https://facebook.github.io/jest/docs/en/cli.html#options
|
||||
interface GlobalConfig {
|
||||
bail: boolean;
|
||||
collectCoverage: boolean;
|
||||
@@ -824,6 +826,7 @@ declare namespace jest {
|
||||
watchman: boolean;
|
||||
}
|
||||
|
||||
// https://facebook.github.io/jest/docs/en/configuration.html#options
|
||||
interface ProjectConfig {
|
||||
automock: boolean;
|
||||
browser: boolean;
|
||||
@@ -863,7 +866,7 @@ declare namespace jest {
|
||||
testRunner: string;
|
||||
testURL: string;
|
||||
timers: 'real' | 'fake';
|
||||
transform: Array<[string, Path]>;
|
||||
transform: {[regexpGlob: string]: string};
|
||||
transformIgnorePatterns: Glob[];
|
||||
unmockedModulePathPatterns: Maybe<string[]>;
|
||||
watchPathIgnorePatterns: string[];
|
||||
|
||||
@@ -731,3 +731,24 @@ test('moduleName 2', () => {
|
||||
const moduleName = require('../moduleName');
|
||||
expect(moduleName()).toEqual(2);
|
||||
});
|
||||
|
||||
// Jest config
|
||||
{
|
||||
// tslint:disable-next-line:no-var-requires
|
||||
const {defaults} = require('jest-config') as {defaults: jest.ProjectConfig};
|
||||
|
||||
const config: Partial<jest.ProjectConfig> = {
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)$': 'ts-jest'
|
||||
},
|
||||
testMatch: [
|
||||
...defaults.testMatch,
|
||||
'**/__tests__/**/*.ts?(x)',
|
||||
'**/?(*.)+(spec|test).ts?(x)'
|
||||
],
|
||||
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
|
||||
globals: {
|
||||
'ts-jest': {}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user