File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,8 +30,9 @@ import HttpStream from '../formatter/http_stream'
3030import { promisify } from 'util'
3131import { Writable } from 'stream'
3232import { pathToFileURL } from 'url'
33- import importer from '../importer'
3433
34+ // eslint-disable-next-line @typescript-eslint/no-var-requires
35+ const { importer } = require ( '../importer' )
3536const { incrementing, uuid } = IdGenerator
3637
3738export interface ICliRunResult {
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ import { IParsedArgvFormatOptions } from '../cli/argv_parser'
2121import { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'
2222import HtmlFormatter from './html_formatter'
2323import { pathToFileURL } from 'url'
24- import importer from '../importer'
24+ // eslint-disable-next-line @typescript-eslint/no-var-requires
25+ const { importer } = require ( '../importer' )
2526
2627interface IGetStepDefinitionSnippetBuilderOptions {
2728 cwd : string
Original file line number Diff line number Diff line change 1- /*
2- Provides the async `import()` function to source code that needs it,
3- without having it transpiled down to commonjs `require()` by TypeScript.
4- See https://github.com/microsoft/TypeScript/issues/43329.
5- */
6-
71/**
2+ * Provides the async `import()` function to source code that needs it,
3+ * without having it transpiled down to commonjs `require()` by TypeScript.
4+ * See https://github.com/microsoft/TypeScript/issues/43329.
5+ *
86 * @param {any } descriptor - A URL or path for the module to load
97 * @return {Promise<any> } Promise that resolves to the loaded module
108 */
119async function importer ( descriptor ) {
1210 return await import ( descriptor )
1311}
1412
15- module . exports = importer
13+ module . exports = { importer }
Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ import { IRuntimeOptions } from '../index'
1919import { PredictableTestRunStopwatch , RealTestRunStopwatch } from '../stopwatch'
2020import { duration } from 'durations'
2121import { pathToFileURL } from 'url'
22- import importer from '../../importer'
2322
23+ // eslint-disable-next-line @typescript-eslint/no-var-requires
24+ const { importer } = require ( '../../importer' )
2425const { uuid } = IdGenerator
2526
2627type IExitFunction = ( exitCode : number , error ?: Error , message ?: string ) => void
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
3- "allowJs" : true ,
43 "esModuleInterop" : true ,
54 "lib" : [" es2019" ],
65 "module" : " commonjs" ,
You can’t perform that action at this time.
0 commit comments