@@ -3,7 +3,7 @@ import path from 'node:path';
33import { promisify } from 'node:util' ;
44import { fileURLToPath } from 'node:url' ;
55import { exec , type PromiseWithChild } from 'node:child_process' ;
6- import { beforeAll , describe , test } from 'vitest' ;
6+ import { beforeAll , describe , expect , test } from 'vitest' ;
77import { create , type LanguageType , type TemplateType } from '../index.ts' ;
88
99// Resolve the given path relative to the current file
@@ -57,6 +57,17 @@ for (const template of templates) {
5757 tests . push ( [ `${ template } -${ types } ` , ( ) => exec_async ( `pnpm ${ script } ` , { cwd } ) ] ) ;
5858 script_test_map . set ( script , tests ) ;
5959 }
60+
61+ if ( template === 'demo' ) {
62+ describe ( `local import with extentions` , ( ) => {
63+ test ( `${ template } -${ types } ` , ( ) => {
64+ const ending = types === 'typescript' ? 'ts' : 'js' ;
65+ const gameFile = path . join ( cwd , `src/routes/sverdle/game.${ ending } ` ) ;
66+ const gameFileContent = fs . readFileSync ( gameFile , 'utf-8' ) ;
67+ expect ( gameFileContent ) . toContain ( `./words.server.${ ending } ` ) ;
68+ } ) ;
69+ } ) ;
70+ }
6071 }
6172}
6273
0 commit comments