@@ -5,7 +5,7 @@ import fetch from 'node-fetch';
5
5
import { chromium } from 'playwright-chromium' ;
6
6
import { dev } from '../src/core/dev/index.js' ;
7
7
import { 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' ;
9
9
import { load_config } from '../src/core/config/index.js' ;
10
10
import { fileURLToPath , pathToFileURL } from 'url' ;
11
11
import { format } from 'util' ;
@@ -17,7 +17,7 @@ import { format } from 'util';
17
17
async function setup ( { port } ) {
18
18
const base = `http://localhost:${ port } ` ;
19
19
20
- const browser = await chromium . launch ( ) ;
20
+ const browser = await chromium . launch ( { headless : true } ) ;
21
21
22
22
const contexts = {
23
23
js : await browser . newContext ( { javaScriptEnabled : true } ) ,
@@ -165,10 +165,11 @@ function duplicate(test_fn, config, is_build) {
165
165
if ( ! dev ) return ;
166
166
}
167
167
168
- if ( process . env . FILTER && ! name . includes ( process . env . FILTER ) ) return ;
169
-
170
168
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 ) => {
172
173
let response ;
173
174
174
175
if ( start ) {
@@ -188,7 +189,10 @@ function duplicate(test_fn, config, is_build) {
188
189
}
189
190
190
191
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 ) => {
192
196
let response ;
193
197
194
198
if ( start ) {
@@ -332,7 +336,7 @@ async function main() {
332
336
runtime : '../../../../../src/runtime/server/index.js'
333
337
} ) ;
334
338
335
- context . server = await start ( { port, config, cwd, host : undefined , https : false } ) ;
339
+ context . server = await preview ( { port, config, cwd, host : undefined , https : false } ) ;
336
340
Object . assign ( context , await setup ( { port } ) ) ;
337
341
} catch ( e ) {
338
342
// the try-catch is necessary pending https://github.com./lukeed/uvu/issues/80
0 commit comments