@@ -12,7 +12,8 @@ import {
1212 fetchPageText ,
1313 reloadPage ,
1414 readFileContent ,
15- IS_SVELTE_BASELINE
15+ IS_SVELTE_BASELINE ,
16+ getServerErrors
1617} from '~utils' ;
1718
1819import glob from 'tiny-glob' ;
@@ -95,6 +96,11 @@ describe('kit-node', () => {
9596 expect ( browserLogs . some ( ( x ) => x === 'onMount dynamic imported isSSR: false' ) ) . toBe ( true ) ;
9697 } ) ;
9798
99+ it ( 'should load dynamic import with css' , async ( ) => {
100+ expect ( await getText ( '#dynamic-imported' ) ) . toBe ( "i'm blue" ) ;
101+ expect ( await getColor ( '#css-transform' ) ) . toBe ( 'blue' ) ;
102+ } ) ;
103+
98104 it ( 'should respect transforms' , async ( ) => {
99105 expect ( await getText ( '#js-transform' ) ) . toBe ( 'Hello world' ) ;
100106 expect ( await getColor ( '#css-transform' ) ) . toBe ( 'red' ) ;
@@ -197,6 +203,12 @@ describe('kit-node', () => {
197203 expect ( await getText ( '#hmr-test2' ) ) . toBe ( 'bar' ) ;
198204 } ) ;
199205
206+ it ( 'should not have errors on reload' , async ( ) => {
207+ expect ( getServerErrors ( ) , 'error log of `vite dev` is not empty before reload' ) . toEqual ( [ ] ) ;
208+ await reloadPage ( ) ;
209+ expect ( getServerErrors ( ) , 'error log of `vite dev` is not empty after reload' ) . toEqual ( [ ] ) ;
210+ } ) ;
211+
200212 describe ( 'child component update' , ( ) => {
201213 const updateChild = editFileAndWaitForHmrComplete . bind ( null , 'src/lib/Child.svelte' ) ;
202214 const updateCounter = editFileAndWaitForHmrComplete . bind ( null , 'src/lib/Counter.svelte' ) ;
0 commit comments