@@ -4,51 +4,51 @@ import { execSync } from 'node:child_process';
44import path from 'node:path' ;
55
66test ( '$lib/*.server.* is not statically importable from the client' , ( ) => {
7- // assert.throws(
8- // () =>
9- execSync ( 'pnpm build' , {
10- cwd : path . join ( process . cwd ( ) , 'apps/server-only-module' ) ,
11- stdio : 'pipe' ,
12- timeout : 15000
13- } ) ;
14- // /.*Cannot import \$lib\/test.server.js into client-side code:.*/gs
15- // );
7+ assert . throws (
8+ ( ) =>
9+ execSync ( 'pnpm build' , {
10+ cwd : path . join ( process . cwd ( ) , 'apps/server-only-module' ) ,
11+ stdio : 'pipe' ,
12+ timeout : 15000
13+ } ) ,
14+ / .* C a n n o t i m p o r t \$ l i b \/ t e s t .s e r v e r .j s i n t o c l i e n t - s i d e c o d e : .* / gs
15+ ) ;
1616} ) ;
1717
1818test ( '$lib/*.server.* is not dynamically importable from the client' , ( ) => {
19- // assert.throws(
20- // () =>
21- execSync ( 'pnpm build' , {
22- cwd : path . join ( process . cwd ( ) , 'apps/server-only-module-dynamic-import' ) ,
23- stdio : 'pipe' ,
24- timeout : 15000
25- } ) ;
26- // /.*Cannot import \$lib\/test.server.js into client-side code:.*/gs
27- // );
19+ assert . throws (
20+ ( ) =>
21+ execSync ( 'pnpm build' , {
22+ cwd : path . join ( process . cwd ( ) , 'apps/server-only-module-dynamic-import' ) ,
23+ stdio : 'pipe' ,
24+ timeout : 15000
25+ } ) ,
26+ / .* C a n n o t i m p o r t \$ l i b \/ t e s t .s e r v e r .j s i n t o c l i e n t - s i d e c o d e : .* / gs
27+ ) ;
2828} ) ;
2929
3030test ( '$lib/server/* is not statically importable from the client' , ( ) => {
31- // assert.throws(
32- // () =>
33- execSync ( 'pnpm build' , {
34- cwd : path . join ( process . cwd ( ) , 'apps/server-only-folder' ) ,
35- stdio : 'pipe' ,
36- timeout : 15000
37- } ) ;
38- // /.*Cannot import \$lib\/server\/something\/test.js into client-side code:.*/gs
39- // );
31+ assert . throws (
32+ ( ) =>
33+ execSync ( 'pnpm build' , {
34+ cwd : path . join ( process . cwd ( ) , 'apps/server-only-folder' ) ,
35+ stdio : 'pipe' ,
36+ timeout : 15000
37+ } ) ,
38+ / .* C a n n o t i m p o r t \$ l i b \/ s e r v e r \/ s o m e t h i n g \/ t e s t .j s i n t o c l i e n t - s i d e c o d e : .* / gs
39+ ) ;
4040} ) ;
4141
4242test ( '$lib/server/* is not dynamically importable from the client' , ( ) => {
43- // assert.throws(
44- // () =>
45- execSync ( 'pnpm build' , {
46- cwd : path . join ( process . cwd ( ) , 'apps/server-only-folder-dynamic-import' ) ,
47- stdio : 'pipe' ,
48- timeout : 15000
49- } ) ;
50- // /.*Cannot import \$lib\/server\/something\/test.js into client-side code:.*/gs
51- // );
43+ assert . throws (
44+ ( ) =>
45+ execSync ( 'pnpm build' , {
46+ cwd : path . join ( process . cwd ( ) , 'apps/server-only-folder-dynamic-import' ) ,
47+ stdio : 'pipe' ,
48+ timeout : 15000
49+ } ) ,
50+ / .* C a n n o t i m p o r t \$ l i b \/ s e r v e r \/ s o m e t h i n g \/ t e s t .j s i n t o c l i e n t - s i d e c o d e : .* / gs
51+ ) ;
5252} ) ;
5353
5454test . run ( ) ;
0 commit comments