@@ -6,7 +6,7 @@ import mochaSetupRaw from "./raw/mocha-setup.js?raw";
66
77export function generateManifest ( ) : Record < string , unknown > {
88 const manifestStr = manifestRaw
9- . replace ( "__TESTER_PLUGIN_ID__" , TESTER_PLUGIN_ID ) ;
9+ . replaceAll ( "__TESTER_PLUGIN_ID__" , TESTER_PLUGIN_ID ) ;
1010
1111 return JSON . parse ( manifestStr ) ;
1212}
@@ -17,10 +17,10 @@ export function generateBootstrap(options: {
1717 waitForPlugin : string ;
1818} ) : string {
1919 return bootstrapRaw
20- . replace ( "__PORT__" , String ( options . port ) )
21- . replace ( "__STARTUP_DELAY__" , String ( options . startupDelay || 1000 ) )
22- . replace ( "__WAIT_FOR_PLUGIN__" , options . waitForPlugin )
23- . replace ( "__TESTER_PLUGIN_REF__" , TESTER_PLUGIN_REF ) ;
20+ . replaceAll ( "__PORT__" , String ( options . port ) )
21+ . replaceAll ( "__STARTUP_DELAY__" , String ( options . startupDelay || 1000 ) )
22+ . replaceAll ( "__WAIT_FOR_PLUGIN__" , options . waitForPlugin )
23+ . replaceAll ( "__TESTER_PLUGIN_REF__" , TESTER_PLUGIN_REF ) ;
2424}
2525
2626export function generateHtml (
@@ -29,7 +29,9 @@ export function generateHtml(
2929) : string {
3030 const tests = testFiles . map ( f => `<script src="${ f } "></script>` ) . join ( "\n " ) ;
3131
32- return htmlRaw . replace ( "__TEST_FILES__" , tests ) . replace ( "___SETUP_CODE___" , setupCode ) ;
32+ return htmlRaw
33+ . replaceAll ( "__TEST_FILES__" , tests )
34+ . replaceAll ( "__SETUP_CODE__" , setupCode ) ;
3335}
3436
3537export function generateMochaSetup ( options : {
@@ -39,8 +41,8 @@ export function generateMochaSetup(options: {
3941 exitOnFinish : boolean ;
4042} ) : string {
4143 return mochaSetupRaw
42- . replace ( "__TIMEOUT__" , String ( options . timeout || 10000 ) )
43- . replace ( "__PORT__" , String ( options . port ) )
44- . replace ( "__ABORT_ON_FAIL__" , String ( options . abortOnFail ) )
45- . replace ( "__EXIT_ON_FINISH__" , String ( options . exitOnFinish ? "true" : "false" ) ) ;
44+ . replaceAll ( "__TIMEOUT__" , String ( options . timeout || 10000 ) )
45+ . replaceAll ( "__PORT__" , String ( options . port ) )
46+ . replaceAll ( "__ABORT_ON_FAIL__" , String ( options . abortOnFail ) )
47+ . replaceAll ( "__EXIT_ON_FINISH__" , String ( options . exitOnFinish ? "true" : "false" ) ) ;
4648}
0 commit comments