@@ -5,7 +5,7 @@ import fetch from 'node-fetch';
55import { chromium } from 'playwright-chromium' ;
66import { dev } from '../src/core/dev/index.js' ;
77import { build } from '../src/core/build/index.js' ;
8- import { start } from '../src/core/start /index.js' ;
8+ import { preview } from '../src/core/preview /index.js' ;
99import { load_config } from '../src/core/config/index.js' ;
1010import { fileURLToPath , pathToFileURL } from 'url' ;
1111import { format } from 'util' ;
@@ -17,7 +17,7 @@ import { format } from 'util';
1717async function setup ( { port } ) {
1818 const base = `http://localhost:${ port } ` ;
1919
20- const browser = await chromium . launch ( ) ;
20+ const browser = await chromium . launch ( { headless : true } ) ;
2121
2222 const contexts = {
2323 js : await browser . newContext ( { javaScriptEnabled : true } ) ,
@@ -165,10 +165,12 @@ function duplicate(test_fn, config, is_build) {
165165 if ( ! dev ) return ;
166166 }
167167
168- if ( process . env . FILTER && ! name . includes ( process . env . FILTER ) ) return ;
169-
170168 if ( nojs ) {
171- test_fn ( `${ name } [no js]` , async ( context ) => {
169+ name = `${ name } [no js]` ;
170+ if ( process . env . FILTER && ! name . includes ( process . env . FILTER ) ) return ;
171+
172+ test_fn ( name , async ( context ) => {
173+
172174 let response ;
173175
174176 if ( start ) {
@@ -188,7 +190,11 @@ function duplicate(test_fn, config, is_build) {
188190 }
189191
190192 if ( js && ! config . kit . amp ) {
191- test_fn ( `${ name } [js]` , async ( context ) => {
193+ name = `${ name } [js]` ;
194+ if ( process . env . FILTER && ! name . includes ( process . env . FILTER ) ) return ;
195+
196+ test_fn ( name , async ( context ) => {
197+
192198 let response ;
193199
194200 if ( start ) {
@@ -332,7 +338,7 @@ async function main() {
332338 runtime : '../../../../../src/runtime/server/index.js'
333339 } ) ;
334340
335- context . server = await start ( { port, config, cwd, host : undefined , https : false } ) ;
341+ context . server = await preview ( { port, config, cwd, host : undefined , https : false } ) ;
336342 Object . assign ( context , await setup ( { port } ) ) ;
337343 } catch ( e ) {
338344 // the try-catch is necessary pending https://github.com/lukeed/uvu/issues/80
0 commit comments