Skip to content

Commit 488bfbf

Browse files
committed
fix(server): add support for serving json static files
1 parent 3202e88 commit 488bfbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

createTestServer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export async function createTestServer( {
159159

160160
// No .mjs or .cjs files are used in tests
161161
".js": "application/javascript",
162+
".json": "application/json",
162163
".css": "text/css",
163164
".html": "text/html",
164165
".xml": "application/xml",
@@ -209,7 +210,9 @@ export async function createTestServer( {
209210
res.end();
210211
} );
211212
} else {
212-
console.error( `Invalid file extension: ${ ext }` );
213+
if ( !quiet ) {
214+
console.error( `Invalid file extension: ${ ext }` );
215+
}
213216
res.writeHead( 404 );
214217
res.end();
215218
}

0 commit comments

Comments
 (0)