File tree 13 files changed +21
-23
lines changed
jest-resolve-dependencies/src
13 files changed +21
-23
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,22 @@ module.exports = {
17
17
overrides : [
18
18
{
19
19
plugins : [
20
- 'babel-plugin-typescript-strip-namespaces' ,
21
20
'babel-plugin-replace-ts-export-assignment' ,
22
21
require . resolve (
23
22
'./scripts/babel-plugin-jest-replace-ts-require-assignment.js' ,
24
23
) ,
25
24
] ,
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
+ ] ,
27
36
test : / \. t s x ? $ / ,
28
37
} ,
29
38
// we want this file to keep `import()`, so exclude the transform for it
Original file line number Diff line number Diff line change 25
25
"ansi-styles" : " ^4.2.0" ,
26
26
"babel-eslint" : " ^10.0.3" ,
27
27
"babel-plugin-replace-ts-export-assignment" : " ^0.0.2" ,
28
- "babel-plugin-typescript-strip-namespaces" : " ^1.1.1" ,
29
28
"camelcase" : " ^6.0.0" ,
30
29
"chalk" : " ^4.0.0" ,
31
30
"chokidar" : " ^3.3.0" ,
Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ expect.extractExpectedAssertionsErrors = extractExpectedAssertionsErrors;
421
421
422
422
const expectExport = expect as Expect ;
423
423
424
- namespace expectExport {
424
+ declare namespace expectExport {
425
425
export type MatcherState = JestMatcherState ;
426
426
export interface Matchers < R > extends MatcherInterface < R > { }
427
427
}
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ type Watcher = {
104
104
type WorkerInterface = { worker : typeof worker ; getSha1 : typeof getSha1 } ;
105
105
106
106
// TODO: Ditch namespace when this module exports ESM
107
- namespace HasteMap {
107
+ declare namespace HasteMap {
108
108
export type ModuleMap = HasteModuleMap ;
109
109
export type SerializableModuleMap = HasteSerializableModuleMap ;
110
110
export type FS = HasteFS ;
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ const addSnapshotData = (
220
220
return results ;
221
221
} ;
222
222
223
- namespace jasmine2 {
223
+ declare namespace jasmine2 {
224
224
export type Jasmine = JestJasmine ;
225
225
}
226
226
Original file line number Diff line number Diff line change 9
9
10
10
type Global = NodeJS . Global ; // | Window – add once TS improves typings;
11
11
12
- namespace JestMock {
12
+ declare namespace JestMock {
13
13
export type ModuleMocker = ModuleMockerClass ;
14
14
export type MockFunctionMetadataType =
15
15
| 'object'
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {FS as HasteFS} from 'jest-haste-map';
11
11
import type { ResolveModuleConfig , ResolverType } from 'jest-resolve' ;
12
12
import { SnapshotResolver , isSnapshotPath } from 'jest-snapshot' ;
13
13
14
- namespace DependencyResolver {
14
+ declare namespace DependencyResolver {
15
15
export type ResolvedModule = {
16
16
file : Config . Path ;
17
17
dependencies : Array < Config . Path > ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ type FindNodeModuleConfig = {
34
34
// TODO: replace with a Map in Jest 26
35
35
type BooleanObject = Record < string , boolean > ;
36
36
37
- namespace Resolver {
37
+ declare namespace Resolver {
38
38
export type ResolveModuleConfig = {
39
39
skipNodeResolution ?: boolean ;
40
40
paths ?: Array < Config . Path > ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ interface WorkerInterface extends Worker {
34
34
worker : typeof worker ;
35
35
}
36
36
37
- namespace TestRunner {
37
+ declare namespace TestRunner {
38
38
export type Test = JestTest ;
39
39
export type OnTestFailure = JestOnTestFailure ;
40
40
export type OnTestStart = JestOnTestStart ;
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ const fromEntries: typeof Object.fromEntries =
107
107
} , { } ) ;
108
108
} ;
109
109
110
- namespace Runtime {
110
+ declare namespace Runtime {
111
111
export type Context = JestContext ;
112
112
// ditch this export when moving to esm - for now we need it for to avoid faulty type elision
113
113
export type RuntimeType = Runtime ;
Original file line number Diff line number Diff line change @@ -560,7 +560,7 @@ const JestSnapshot = {
560
560
utils,
561
561
} ;
562
562
563
- namespace JestSnapshot {
563
+ declare namespace JestSnapshot {
564
564
export type SnapshotResolver = JestSnapshotResolver ;
565
565
export type SnapshotStateType = SnapshotState ;
566
566
}
Original file line number Diff line number Diff line change @@ -530,7 +530,7 @@ prettyFormat.plugins = {
530
530
ReactTestComponent,
531
531
} ;
532
532
533
- namespace prettyFormat {
533
+ declare namespace prettyFormat {
534
534
export type Colors = PrettyFormat . Colors ;
535
535
export type Config = PrettyFormat . Config ;
536
536
export type Options = PrettyFormat . Options ;
Original file line number Diff line number Diff line change @@ -4839,15 +4839,6 @@ __metadata:
4839
4839
languageName: node
4840
4840
linkType: hard
4841
4841
4842
- "babel-plugin-typescript-strip-namespaces@npm:^1.1.1":
4843
- version: 1.1.1
4844
- resolution: "babel-plugin-typescript-strip-namespaces@npm:1.1.1"
4845
- peerDependencies:
4846
- "@babel/core": ^7.0.0
4847
- checksum: f0e59ea0d37bcf98cc7891db8f6089b1a1f2607e43ddc6a8c6b19ed782f1277f8f46998267e8ab636c12f8d0ed70194fb0a84ab610f4df463e1712e493002ee9
4848
- languageName: node
4849
- linkType: hard
4850
-
4851
4842
"babel-preset-current-node-syntax@npm:^0.1.3":
4852
4843
version: 0.1.4
4853
4844
resolution: "babel-preset-current-node-syntax@npm:0.1.4"
@@ -17152,7 +17143,6 @@ fsevents@^1.2.7:
17152
17143
ansi-styles: ^4.2.0
17153
17144
babel-eslint: ^10.0.3
17154
17145
babel-plugin-replace-ts-export-assignment: ^0.0.2
17155
- babel-plugin-typescript-strip-namespaces: ^1.1.1
17156
17146
camelcase: ^6.0.0
17157
17147
chalk: ^4.0.0
17158
17148
chokidar: ^3.3.0
You can’t perform that action at this time.
0 commit comments