register ts/esm loader

This commit is contained in:
Simon Knott 2024-09-03 09:36:46 +02:00
parent 92533ce64d
commit b9173b05ef
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 7 additions and 1 deletions

View file

@ -197,6 +197,8 @@ async function runTests(args: string[], opts: { [key: string]: any }) {
} }
); );
await stopProfiling('runner'); await stopProfiling('runner');
if (status === 'restarted')
return;
const exitCode = status === 'interrupted' ? 130 : (status === 'passed' ? 0 : 1); const exitCode = status === 'interrupted' ? 130 : (status === 'passed' ? 0 : 1);
gracefullyProcessExitDoNotHang(exitCode); gracefullyProcessExitDoNotHang(exitCode);
return; return;

View file

@ -27,6 +27,7 @@ import { TestServerDispatcher } from './testServer';
import { EventEmitter } from 'stream'; import { EventEmitter } from 'stream';
import { type TestServerTransport, TestServerConnection } from '../isomorphic/testServerConnection'; import { type TestServerTransport, TestServerConnection } from '../isomorphic/testServerConnection';
import { TeleSuiteUpdater } from '../isomorphic/teleSuiteUpdater'; import { TeleSuiteUpdater } from '../isomorphic/teleSuiteUpdater';
import { restartWithExperimentalTsEsm } from '../common/configLoader';
class InMemoryTransport extends EventEmitter implements TestServerTransport { class InMemoryTransport extends EventEmitter implements TestServerTransport {
public readonly _send: (data: string) => void; public readonly _send: (data: string) => void;
@ -67,7 +68,10 @@ interface WatchModeOptions {
grep?: string; grep?: string;
} }
export async function runWatchModeLoop(configLocation: ConfigLocation, initialOptions: WatchModeOptions): Promise<FullResult['status']> { export async function runWatchModeLoop(configLocation: ConfigLocation, initialOptions: WatchModeOptions): Promise<FullResult['status'] | 'restarted'> {
if (restartWithExperimentalTsEsm(undefined, true))
return 'restarted';
const options: WatchModeOptions = { ...initialOptions }; const options: WatchModeOptions = { ...initialOptions };
const testServerDispatcher = new TestServerDispatcher(configLocation); const testServerDispatcher = new TestServerDispatcher(configLocation);