From a7e612e5be89bc0666b5cd20bcf8e3bbdc4f813d Mon Sep 17 00:00:00 2001 From: Tian Feng Date: Tue, 16 Jul 2024 16:53:12 -0700 Subject: [PATCH] feat: Support --esm flag (#235) * feat: Support --esm * update test cli path --- src/testcafe-runner.ts | 7 +++++-- src/type.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/testcafe-runner.ts b/src/testcafe-runner.ts index aee803f5..da905bd5 100644 --- a/src/testcafe-runner.ts +++ b/src/testcafe-runner.ts @@ -206,6 +206,9 @@ export function buildCommandLine( cli.push('--compiler-options', options); } } + if (suite.esm) { + cli.push('--esm'); + } // Screenshots if (suite.screenshots) { @@ -286,8 +289,8 @@ async function runTestCafe( '..', 'node_modules', 'testcafe', - 'lib', - 'cli', + 'bin', + 'testcafe-with-v8-flag-filter.js', ); const testcafeProc = spawn( diff --git a/src/type.ts b/src/type.ts index ba377143..17112dea 100644 --- a/src/type.ts +++ b/src/type.ts @@ -90,6 +90,7 @@ export type Suite = { filter?: Filter; preExec?: string[]; timeout?: number; + esm?: boolean; }; export type TestCafeConfig = {