@@ -36,31 +36,31 @@ export default defineCommentComponent(() => {
3636
3737describe ( 'production' , ( ) => {
3838 it ( 'should work in production' , async ( ) => {
39- expect ( await transform ( testScript , `test.ts` , createMockContext ( ) , { } , false , createMockServer ( true , false ) ) ) . toMatchSnapshot ( )
39+ expect ( await transform ( testScript , `test.n. ts` , createMockContext ( ) , { } , false , createMockServer ( true , false ) ) ) . toMatchSnapshot ( )
4040 } )
4141
4242 it ( 'should work with style imports' , async ( ) => {
43- expect ( await transform ( `import 'style.css'; \n ${ testScript } ` , `test.ts` , createMockContext ( ) , { } , false , createMockServer ( true , false ) ) ) . toMatchSnapshot ( )
43+ expect ( await transform ( `import 'style.css'; \n ${ testScript } ` , `test.n. ts` , createMockContext ( ) , { } , false , createMockServer ( true , false ) ) ) . toMatchSnapshot ( )
4444 } )
4545} )
4646
4747describe ( 'development' , ( ) => {
4848 it ( 'should work and inject HMR code' , async ( ) => {
49- expect ( await transform ( testScript , `test.ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) ) ) . toMatchSnapshot ( )
49+ expect ( await transform ( testScript , `test.n. ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) ) ) . toMatchSnapshot ( )
5050 } )
5151
5252 it ( 'should detect script change and inject HMR code' , async ( ) => {
53- const first = await transform ( testScript , `test.ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) )
53+ const first = await transform ( testScript , `test.n. ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) )
5454
55- const second = await transform ( testScript . replace ( 'Good Morning' , 'Good Afternoon' ) , `test.ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) , first . cache )
55+ const second = await transform ( testScript . replace ( 'Good Morning' , 'Good Afternoon' ) , `test.n. ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) , first . cache )
5656 expect ( second . result ?. code ) . toContain ( 'const __VUE_HMR_SCRIPT_CHANGED__ = true;' )
5757 expect ( second . result ?. code ) . not . toContain ( 'changed: true,' )
5858 } )
5959
6060 it ( 'should detect template change and inject HMR code' , async ( ) => {
61- const first = await transform ( testScript , `test.ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) )
61+ const first = await transform ( testScript , `test.n. ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) )
6262
63- const second = await transform ( testScript . replace ( 'Hello World' , 'Hello Vue Note' ) , `test.ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) , first . cache )
63+ const second = await transform ( testScript . replace ( 'Hello World' , 'Hello Vue Note' ) , `test.n. ts` , createMockContext ( ) , { } , false , createMockServer ( false , true ) , first . cache )
6464 expect ( second . result ?. code ) . not . toContain ( 'const __VUE_HMR_SCRIPT_CHANGED__ = true;' )
6565 expect ( second . result ?. code ) . toContain ( 'changed: true,' )
6666 } )
0 commit comments