Skip to content

Commit 6355af6

Browse files
committed
fix imports
1 parent 483ef63 commit 6355af6

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/test-storybook.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
import { JestOptions } from './util/getCliOptions';
55
import fs from 'fs';
66

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';
1919

2020
const glob = function (pattern: string, options?: any): Promise<string[]> {
2121
return new Promise((resolve, reject) => {
22-
glob_og(pattern, options, (err: Error, files: string[]) =>
22+
glob_og(pattern, options, (err: any, files: string[]) =>
2323
err === null ? resolve(files) : reject(err)
2424
);
2525
});
@@ -31,7 +31,7 @@ process.env.NODE_ENV = 'test';
3131
process.env.STORYBOOK_TEST_RUNNER = 'true';
3232
process.env.PUBLIC_URL = '';
3333

34-
let getHttpHeaders = (_url: string | URL) => Promise.resolve({});
34+
let getHttpHeaders = (_url: string) => Promise.resolve({});
3535

3636
// Makes the script crash on unhandled rejections instead of silently
3737
// ignoring them. In the future, promise rejections that are not handled will
@@ -165,7 +165,7 @@ async function checkStorybook(url: any) {
165165
}
166166
}
167167

168-
async function getIndexJson(url: string | URL) {
168+
async function getIndexJson(url: string) {
169169
const indexJsonUrl = new URL('index.json', url).toString();
170170
const storiesJsonUrl = new URL('stories.json', url).toString();
171171
const headers = await getHttpHeaders(url);
@@ -204,7 +204,7 @@ async function getIndexJson(url: string | URL) {
204204
`);
205205
}
206206

207-
async function getIndexTempDir(url: any) {
207+
async function getIndexTempDir(url: string) {
208208
let tmpDir: string;
209209
try {
210210
const indexJson = await getIndexJson(url);

src/util/getParsedCliOptions.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import type { CliOptions } from './getCliOptions';
2+
import { program } from 'commander';
23

34
type ParsedCliOptions = {
45
options: CliOptions['runnerOptions'];
56
extraArgs: CliOptions['jestOptions'];
67
};
78

89
export const getParsedCliOptions = (): ParsedCliOptions => {
9-
const { program } = require('commander');
10-
1110
program
1211
.option(
1312
'-i, --index-json',

0 commit comments

Comments
 (0)