@@ -106,36 +106,39 @@ for (const template of templates) {
106106 if ( template [ 0 ] === '.' ) continue ;
107107
108108 for ( const types of /** @type {const } */ ( [ 'checkjs' , 'typescript' ] ) ) {
109- const cwd = path . join ( test_workspace_dir , `${ template } -${ types } ` ) ;
110- fs . rmSync ( cwd , { recursive : true , force : true } ) ;
111-
112- create ( cwd , {
113- name : `create-svelte-test-${ template } -${ types } ` ,
114- template,
115- types,
116- prettier : true ,
117- eslint : true ,
118- playwright : false ,
119- vitest : false ,
120- svelte5 : false
121- } ) ;
122-
123- const pkg = JSON . parse ( fs . readFileSync ( path . join ( cwd , 'package.json' ) , 'utf-8' ) ) ;
124- patch_package_json ( pkg ) ;
125-
126- fs . writeFileSync ( path . join ( cwd , 'package.json' ) , JSON . stringify ( pkg , null , '\t' ) + '\n' ) ;
127-
128- // run provided scripts that are non-blocking. All of them should exit with 0
129- // package script requires lib dir
130- // TODO: lint should run before format
131- const scripts_to_test = [ 'format' , 'lint' , 'check' , 'build' , 'package' ] . filter (
132- ( s ) => s in pkg . scripts
133- ) ;
134-
135- for ( const script of scripts_to_test ) {
136- const tests = script_test_map . get ( script ) ?? [ ] ;
137- tests . push ( [ `${ template } -${ types } ` , ( ) => exec_async ( `pnpm ${ script } ` , { cwd } ) ] ) ;
138- script_test_map . set ( script , tests ) ;
109+ for ( const svelteVersion of /** @type {const } */ ( [ 'svelte4' , 'svelte5' ] ) ) {
110+ const test_id = `${ template } -${ types } -${ svelteVersion } ` ;
111+ const cwd = path . join ( test_workspace_dir , test_id ) ;
112+ fs . rmSync ( cwd , { recursive : true , force : true } ) ;
113+
114+ create ( cwd , {
115+ name : `create-svelte-test-${ test_id } ` ,
116+ template,
117+ types,
118+ prettier : true ,
119+ eslint : true ,
120+ playwright : false ,
121+ vitest : false ,
122+ svelte5 : svelteVersion === 'svelte5'
123+ } ) ;
124+
125+ const pkg = JSON . parse ( fs . readFileSync ( path . join ( cwd , 'package.json' ) , 'utf-8' ) ) ;
126+ patch_package_json ( pkg ) ;
127+
128+ fs . writeFileSync ( path . join ( cwd , 'package.json' ) , JSON . stringify ( pkg , null , '\t' ) + '\n' ) ;
129+
130+ // run provided scripts that are non-blocking. All of them should exit with 0
131+ // package script requires lib dir
132+ // TODO: lint should run before format
133+ const scripts_to_test = [ 'format' , 'lint' , 'check' , 'build' , 'package' ] . filter (
134+ ( s ) => s in pkg . scripts
135+ ) ;
136+
137+ for ( const script of scripts_to_test ) {
138+ const tests = script_test_map . get ( script ) ?? [ ] ;
139+ tests . push ( [ test_id , ( ) => exec_async ( `pnpm ${ script } ` , { cwd } ) ] ) ;
140+ script_test_map . set ( script , tests ) ;
141+ }
139142 }
140143 }
141144}
0 commit comments