Report blocked requests even when a modal layout case fails earlier

Open Beginner friendly
#9,232 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js
Domain
testing

Research direction

Open packages/dashboard/scripts/modal-buttons-layout.test.mjs and find where assert.deepEqual(blocked, [], …) runs after measure() and the case's own assertions. Read the surrounding helper that collects blocked requests and WebSocket attempts, then move the reporting into a finally (or catch-and-rethrow) so it runs on any failure path. Run the file with node --test packages/dashboard/scripts/modal-buttons-layout.test.mjs; done looks like a deliberately blocked URL named in the failure output while pass/fail results stay unchanged.

Written by the indexing model from the issue text.

Description

enhancement from-review

Context

Filed from: #9231

Identified during the review of PR #9231 (#8779).

Description

In packages/dashboard/scripts/modal-buttons-layout.test.mjs, the check that no request left the fixture server and no WebSocket was attempted (assert.deepEqual(blocked, [], …)) runs only after measure() and the case's own assertions succeed. If a blocked request causes a timeout or an earlier assertion to fail, the case still fails, but its error does not name the blocked URL, which makes the cause harder to see. Behaviour stays fail-closed: a blocked attempt can never let a case pass.

Related nitpicks from the same review, optional:

  • context.route('**/*') could use an explicit match-all (/.*/ or a predicate) instead of relying on glob conversion.
  • In the static server, ENOTDIR/ELOOP from realpathSync return 500 rather than 404 (no safety impact).

Original Review Comment

The blocked-request assertion only runs after measure() and fn() succeed. If a blocked request causes a timeout or an assertion failure, the case reports that failure without naming the blocked URL.

Acceptance Criteria

  • A case that fails for any reason also reports any blocked request or WebSocket attempt in its failure output
  • Pass/fail behaviour is unchanged (any blocked attempt still fails the case)
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 19m
Merged PRs (30d)
263

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.