Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/core/test/testing-run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,21 +449,21 @@ test("a pinned bundled run passes its own target and output directory, removed a

test("aborting a run kills its process and reports it as cancelled", async () => {
const root = await project();
let killed = false;
let killSignal: NodeJS.Signals | undefined;
const controller = new AbortController();
const hanging = (() => {
const child = new EventEmitter() as EventEmitter & { stdout: Readable; stderr: Readable; kill: () => void };
const child = new EventEmitter() as EventEmitter & { stdout: Readable; stderr: Readable; kill: (signal: NodeJS.Signals) => void };
child.stdout = Readable.from([]); child.stderr = Readable.from([]);
child.kill = () => { killed = true; };
child.kill = signal => { killSignal = signal; };
queueMicrotask(() => controller.abort());
return child;
}) as never;
const run = runRecordedTest({
projectPath: root, relativePath: FILE, untilSource: 'test("x", async () => {});\n',
runtime: { mode: "bundled", root: bundledE2eRoot() }, bundledTarget: { platform: "ios", bundleId: "a.b" },
}, { spawner: hanging, signal: controller.signal });
setTimeout(() => controller.abort(), 20);
await assert.rejects(run, /cancelled/);
assert.equal(killed, true);
await assert.rejects(run, { outcome: "cancelled", message: /cancelled/ });
assert.equal(killSignal, "SIGTERM");
});

// ---- Project-mode matrix lanes: the config text, copied with one target's device pinned -------------------
Expand Down
Loading