File tree Expand file tree Collapse file tree 13 files changed +21
-23
lines changed
jest-resolve-dependencies/src Expand file tree Collapse file tree 13 files changed +21
-23
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,22 @@ module.exports = {
1717 overrides : [
1818 {
1919 plugins : [
20- 'babel-plugin-typescript-strip-namespaces' ,
2120 'babel-plugin-replace-ts-export-assignment' ,
2221 require . resolve (
2322 './scripts/babel-plugin-jest-replace-ts-require-assignment.js' ,
2423 ) ,
2524 ] ,
26- presets : [ '@babel/preset-typescript' ] ,
25+ presets : [
26+ [
27+ '@babel/preset-typescript' ,
28+ {
29+ // will be the default in Babel 8, so let's just turn it on now
30+ allowDeclareFields : true ,
31+ // will be default in the future, but we don't want to use it
32+ allowNamespaces : false ,
33+ } ,
34+ ] ,
35+ ] ,
2736 test : / \. t s x ? $ / ,
2837 } ,
2938 // we want this file to keep `import()`, so exclude the transform for it
Original file line number Diff line number Diff line change 2525 "ansi-styles" : " ^4.2.0" ,
2626 "babel-eslint" : " ^10.0.3" ,
2727 "babel-plugin-replace-ts-export-assignment" : " ^0.0.2" ,
28- "babel-plugin-typescript-strip-namespaces" : " ^1.1.1" ,
2928 "camelcase" : " ^6.0.0" ,
3029 "chalk" : " ^4.0.0" ,
3130 "chokidar" : " ^3.3.0" ,
Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ expect.extractExpectedAssertionsErrors = extractExpectedAssertionsErrors;
421421
422422const expectExport = expect as Expect ;
423423
424- namespace expectExport {
424+ declare namespace expectExport {
425425 export type MatcherState = JestMatcherState ;
426426 export interface Matchers < R > extends MatcherInterface < R > { }
427427}
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ type Watcher = {
104104type WorkerInterface = { worker : typeof worker ; getSha1 : typeof getSha1 } ;
105105
106106// TODO: Ditch namespace when this module exports ESM
107- namespace HasteMap {
107+ declare namespace HasteMap {
108108 export type ModuleMap = HasteModuleMap ;
109109 export type SerializableModuleMap = HasteSerializableModuleMap ;
110110 export type FS = HasteFS ;
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ const addSnapshotData = (
220220 return results ;
221221} ;
222222
223- namespace jasmine2 {
223+ declare namespace jasmine2 {
224224 export type Jasmine = JestJasmine ;
225225}
226226
Original file line number Diff line number Diff line change 99
1010type Global = NodeJS . Global ; // | Window – add once TS improves typings;
1111
12- namespace JestMock {
12+ declare namespace JestMock {
1313 export type ModuleMocker = ModuleMockerClass ;
1414 export type MockFunctionMetadataType =
1515 | 'object'
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {FS as HasteFS} from 'jest-haste-map';
1111import type { ResolveModuleConfig , ResolverType } from 'jest-resolve' ;
1212import { SnapshotResolver , isSnapshotPath } from 'jest-snapshot' ;
1313
14- namespace DependencyResolver {
14+ declare namespace DependencyResolver {
1515 export type ResolvedModule = {
1616 file : Config . Path ;
1717 dependencies : Array < Config . Path > ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ type FindNodeModuleConfig = {
3434// TODO: replace with a Map in Jest 26
3535type BooleanObject = Record < string , boolean > ;
3636
37- namespace Resolver {
37+ declare namespace Resolver {
3838 export type ResolveModuleConfig = {
3939 skipNodeResolution ?: boolean ;
4040 paths ?: Array < Config . Path > ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ interface WorkerInterface extends Worker {
3434 worker : typeof worker ;
3535}
3636
37- namespace TestRunner {
37+ declare namespace TestRunner {
3838 export type Test = JestTest ;
3939 export type OnTestFailure = JestOnTestFailure ;
4040 export type OnTestStart = JestOnTestStart ;
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ const fromEntries: typeof Object.fromEntries =
107107 } , { } ) ;
108108 } ;
109109
110- namespace Runtime {
110+ declare namespace Runtime {
111111 export type Context = JestContext ;
112112 // ditch this export when moving to esm - for now we need it for to avoid faulty type elision
113113 export type RuntimeType = Runtime ;
You can’t perform that action at this time.
0 commit comments