@@ -15,15 +15,15 @@ const mockBasePath = path.join(__dirname, 'path', 'to');
15
15
16
16
const mockConfig = {
17
17
transforms : {
18
- '10.0.0' : 'path/to/transform.js ' ,
18
+ '10.0.0' : 'path/to/transform.ts ' ,
19
19
} ,
20
20
} ;
21
21
22
22
describe ( 'fetcher' , ( ) => {
23
23
let mockMatchedPaths : string [ ] = [ ] ;
24
24
25
25
beforeEach ( ( ) => {
26
- mockMatchedPaths = [ path . join ( mockBasePath , 'hypermod.config.js ' ) ] ;
26
+ mockMatchedPaths = [ path . join ( mockBasePath , 'hypermod.config.ts ' ) ] ;
27
27
28
28
( globby as unknown as jest . Mock ) . mockImplementation ( ( ) =>
29
29
Promise . resolve ( mockMatchedPaths ) ,
@@ -38,10 +38,10 @@ describe('fetcher', () => {
38
38
39
39
describe ( 'fetchConfig' , ( ) => {
40
40
it ( 'fetches config with default export' , async ( ) => {
41
- const mockFilePath = `${ __dirname } /path/to/hypermod.config.js ` ;
41
+ const mockFilePath = `${ __dirname } /path/to/hypermod.config.ts ` ;
42
42
43
43
jest . mock (
44
- `${ __dirname } /path/to/hypermod.config.js ` ,
44
+ `${ __dirname } /path/to/hypermod.config.ts ` ,
45
45
( ) => ( { __esModule : true , default : mockConfig } ) ,
46
46
{ virtual : true } ,
47
47
) ;
@@ -54,7 +54,7 @@ describe('fetcher', () => {
54
54
55
55
it ( 'fetches config with named export' , async ( ) => {
56
56
jest . mock (
57
- path . join ( mockBasePath , 'hypermod.config.js ' ) ,
57
+ path . join ( mockBasePath , 'hypermod.config.ts ' ) ,
58
58
( ) => mockConfig ,
59
59
{
60
60
virtual : true ,
@@ -65,7 +65,7 @@ describe('fetcher', () => {
65
65
66
66
expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
67
67
expect ( configMeta ! . filePath ) . toEqual (
68
- path . join ( mockBasePath , 'hypermod.config.js ' ) ,
68
+ path . join ( mockBasePath , 'hypermod.config.ts ' ) ,
69
69
) ;
70
70
} ) ;
71
71
@@ -106,7 +106,7 @@ describe('fetcher', () => {
106
106
107
107
describe ( 'fetchPackage' , ( ) => {
108
108
it ( 'correctly fetches package and returns a config' , async ( ) => {
109
- const mockFilePath = 'path/to/config.hypermod.js ' ;
109
+ const mockFilePath = 'path/to/config.hypermod.ts ' ;
110
110
const mockPackageManager = {
111
111
install : jest . fn ( ) ,
112
112
getInfo : jest . fn ( ) . mockReturnValue ( { location : mockFilePath } ) ,
@@ -154,7 +154,7 @@ describe('fetcher', () => {
154
154
155
155
expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
156
156
expect ( configMeta ! . filePath ) . toEqual (
157
- mockBasePath + '/hypermod.config.js ' ,
157
+ mockBasePath + '/hypermod.config.ts ' ,
158
158
) ;
159
159
} ) ;
160
160
@@ -177,7 +177,7 @@ describe('fetcher', () => {
177
177
install : jest . fn ( ) ,
178
178
require : jest . fn ( ) . mockReturnValueOnce ( mockConfig ) ,
179
179
getInfo : jest . fn ( ) . mockReturnValue ( {
180
- location : mockBasePath + '/index.js ' ,
180
+ location : mockBasePath + '/index.ts ' ,
181
181
} ) ,
182
182
} ;
183
183
@@ -187,15 +187,15 @@ describe('fetcher', () => {
187
187
) ;
188
188
189
189
expect ( configMeta ! . config ) . toEqual ( mockConfig ) ;
190
- expect ( configMeta ! . filePath ) . toEqual ( mockBasePath + '/index.js ' ) ;
190
+ expect ( configMeta ! . filePath ) . toEqual ( mockBasePath + '/index.ts ' ) ;
191
191
} ) ;
192
192
193
193
it ( 'throws if entrypoint-based config does not contain a valid config (and there are no config files available elsewhere)' , async ( ) => {
194
194
const mockPackageManager = {
195
195
install : jest . fn ( ) ,
196
196
require : jest . fn ( ) . mockReturnValueOnce ( { } ) ,
197
197
getInfo : jest . fn ( ) . mockReturnValue ( {
198
- location : mockBasePath + '/index.js ' ,
198
+ location : mockBasePath + '/index.ts ' ,
199
199
} ) ,
200
200
} ;
201
201
0 commit comments