4
4
import { JestOptions } from './util/getCliOptions' ;
5
5
import fs from 'fs' ;
6
6
7
- const { execSync } = require ( 'child_process' ) ;
8
- const fetch = require ( 'node-fetch' ) ;
9
- const canBindToHost = require ( 'can-bind-to-host' ) . default ;
10
- const dedent = require ( 'ts-dedent' ) . default ;
11
- const path = require ( 'path' ) ;
12
- const tempy = require ( 'tempy' ) ;
13
- const { getCliOptions } = require ( './util/getCliOptions' ) ;
14
- const { getStorybookMetadata } = require ( './util/getStorybookMetadata' ) ;
15
- const { getTestRunnerConfig } = require ( './util/getTestRunnerConfig' ) ;
16
- const { transformPlaywrightJson } = require ( './playwright/transformPlaywrightJson' ) ;
17
-
18
- const glob_og = require ( 'glob' ) ;
7
+ import { execSync } from 'child_process' ;
8
+ import fetch from 'node-fetch' ;
9
+ import canBindToHost from 'can-bind-to-host' ;
10
+ import dedent from 'ts-dedent' ;
11
+ import path from 'path' ;
12
+ import tempy from 'tempy' ;
13
+ import { getCliOptions } from './util/getCliOptions' ;
14
+ import { getStorybookMetadata } from './util/getStorybookMetadata' ;
15
+ import { getTestRunnerConfig } from './util/getTestRunnerConfig' ;
16
+ import { transformPlaywrightJson } from './playwright/transformPlaywrightJson' ;
17
+
18
+ import glob_og from 'glob' ;
19
19
20
20
const glob = function ( pattern : string , options ?: any ) : Promise < string [ ] > {
21
21
return new Promise ( ( resolve , reject ) => {
22
- glob_og ( pattern , options , ( err : Error , files : string [ ] ) =>
22
+ glob_og ( pattern , options , ( err : any , files : string [ ] ) =>
23
23
err === null ? resolve ( files ) : reject ( err )
24
24
) ;
25
25
} ) ;
@@ -31,7 +31,7 @@ process.env.NODE_ENV = 'test';
31
31
process . env . STORYBOOK_TEST_RUNNER = 'true' ;
32
32
process . env . PUBLIC_URL = '' ;
33
33
34
- let getHttpHeaders = ( _url : string | URL ) => Promise . resolve ( { } ) ;
34
+ let getHttpHeaders = ( _url : string ) => Promise . resolve ( { } ) ;
35
35
36
36
// Makes the script crash on unhandled rejections instead of silently
37
37
// ignoring them. In the future, promise rejections that are not handled will
@@ -165,7 +165,7 @@ async function checkStorybook(url: any) {
165
165
}
166
166
}
167
167
168
- async function getIndexJson ( url : string | URL ) {
168
+ async function getIndexJson ( url : string ) {
169
169
const indexJsonUrl = new URL ( 'index.json' , url ) . toString ( ) ;
170
170
const storiesJsonUrl = new URL ( 'stories.json' , url ) . toString ( ) ;
171
171
const headers = await getHttpHeaders ( url ) ;
@@ -204,7 +204,7 @@ async function getIndexJson(url: string | URL) {
204
204
` ) ;
205
205
}
206
206
207
- async function getIndexTempDir ( url : any ) {
207
+ async function getIndexTempDir ( url : string ) {
208
208
let tmpDir : string ;
209
209
try {
210
210
const indexJson = await getIndexJson ( url ) ;
0 commit comments