fix: run tests in iife to avoid name conflicts (#58805)

This commit is contained in:
Oliver Eyton-Williams
2025-02-15 04:44:31 +01:00
committed by GitHub
parent ceb0e60460
commit 1aeb65b445

View File

@@ -132,7 +132,7 @@ ctx.onmessage = async (e: TestEvaluatorEvent) => {
__utils.flushLogs();
__userCodeWasExecuted = true;
__utils.toggleProxyLogger(true);
${e.data.testString}`)) as unknown;
(async () => {${e.data.testString}})()`)) as unknown;
} catch (err) {
if (__userCodeWasExecuted) {
// rethrow error, since test failed.