diff --git a/server/jest.config.js b/server/jest.config.js index a166802..9d58577 100644 --- a/server/jest.config.js +++ b/server/jest.config.js @@ -12,4 +12,8 @@ module.exports = { '^@mozilla/readability$': '/test/__mocks__/readability.ts', }, testEnvironment: 'node', + // Each suite builds a full Nest app in beforeAll. That takes well under a + // second on an idle machine, but several seconds when every suite starts at + // once on a busy CI runner, past Jest's default 5 s. + testTimeout: 30_000, }; diff --git a/server/test/scenario.controller.spec.ts b/server/test/scenario.controller.spec.ts index d23cd5f..ada18ab 100644 --- a/server/test/scenario.controller.spec.ts +++ b/server/test/scenario.controller.spec.ts @@ -810,7 +810,10 @@ describe("ScenarioController", () => { .expect(200); expect(res.body.id).toBe(runId); - expect(res.body.status).toBe("pending"); + // The scheduler may already have picked the run up + expect(["pending", "in_progress", "pass", "fail"]).toContain( + res.body.status, + ); expect(Array.isArray(res.body.stepRuns)).toBe(true); expect(res.body.stepRuns[0]).toHaveProperty("scenarioStep"); expect(Array.isArray(res.body.logs)).toBe(true);