@@ -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,11 @@ 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 ) => {
172173 let response ;
173174
174175 if ( start ) {
@@ -188,7 +189,10 @@ function duplicate(test_fn, config, is_build) {
188189 }
189190
190191 if ( js && ! config . kit . amp ) {
191- test_fn ( `${ name } [js]` , async ( context ) => {
192+ name = `${ name } [js]` ;
193+ if ( process . env . FILTER && ! name . includes ( process . env . FILTER ) ) return ;
194+
195+ test_fn ( name , async ( context ) => {
192196 let response ;
193197
194198 if ( start ) {
@@ -332,7 +336,7 @@ async function main() {
332336 runtime : '../../../../../src/runtime/server/index.js'
333337 } ) ;
334338
335- context . server = await start ( { port, config, cwd, host : undefined , https : false } ) ;
339+ context . server = await preview ( { port, config, cwd, host : undefined , https : false } ) ;
336340 Object . assign ( context , await setup ( { port } ) ) ;
337341 } catch ( e ) {
338342 // the try-catch is necessary pending https://github.com/lukeed/uvu/issues/80
0 commit comments