[node] Fix ESM dependency support (#9692)

This commit is contained in:
Chris Barber
2023-04-26 12:23:43 -05:00
committed by GitHub
parent fda76691d1
commit 65a6e713c8
54 changed files with 1750 additions and 138 deletions

View File

@@ -2,7 +2,7 @@ import { forkDevServer, readMessage } from '../../src/fork-dev-server';
import { resolve, extname } from 'path';
import fetch from 'node-fetch';
jest.setTimeout(10 * 1000);
jest.setTimeout(20 * 1000);
function testForkDevServer(entrypoint: string) {
const ext = extname(entrypoint);
@@ -10,7 +10,9 @@ function testForkDevServer(entrypoint: string) {
const isEsm = ext === '.mjs';
return forkDevServer({
maybeTranspile: true,
config: {},
config: {
debug: true,
},
isEsm,
isTypeScript,
meta: {},
@@ -18,7 +20,7 @@ function testForkDevServer(entrypoint: string) {
tsConfig: undefined,
workPath: resolve(__dirname, '../dev-fixtures'),
entrypoint,
devServerPath: resolve(__dirname, '../../dist/dev-server.js'),
devServerPath: resolve(__dirname, '../../dist/dev-server.mjs'),
});
}