Skip to content

test: move scenario setup into beforeAll to eliminate inter-test dependencies#4

Merged
NullVoxPopuli merged 2 commits into
implementationfrom
copilot/sub-pr-1-another-one
Mar 14, 2026
Merged

test: move scenario setup into beforeAll to eliminate inter-test dependencies#4
NullVoxPopuli merged 2 commits into
implementationfrom
copilot/sub-pr-1-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

Tests in scenarios.test.js were setting summary inside a test() block, creating an implicit dependency: if that test failed or was skipped, all subsequent assertion tests would silently fail with summary being undefined.

Changes

  • beforeAll setup: runScenario() and readCoverageSummary() moved into beforeAll() — a beforeAll failure marks all tests in the suite as failed with a clear error immediately
  • Purely assertive tests: Individual test() blocks now only contain assertions; the coverage directory existence check is its own standalone test
// Before: summary set inside a test — downstream tests silently broken if this fails
test("run scenario and collect coverage", () => {
  runScenario(scenarioDir);
  summary = readCoverageSummary(scenarioDir);
});

// After: setup isolated from assertions
beforeAll(() => {
  runScenario(scenarioDir);
  summary = readCoverageSummary(scenarioDir);
});

test("coverage directory was created", () => {
  expect(existsSync(join(scenarioDir, "coverage"))).toBe(true);
});

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback from implementation PR test: move scenario setup into beforeAll to eliminate inter-test dependencies Mar 14, 2026
Copilot AI requested a review from NullVoxPopuli March 14, 2026 18:43
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review March 14, 2026 18:57
@NullVoxPopuli NullVoxPopuli merged commit 92ab8fb into implementation Mar 14, 2026
3 checks passed
@NullVoxPopuli NullVoxPopuli deleted the copilot/sub-pr-1-another-one branch March 14, 2026 18:57
@github-actions github-actions Bot mentioned this pull request Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants