Skip to content

Assert: Return error value from rejects() and throws()#1825

Open
MatmaRex wants to merge 1 commit intoqunitjs:mainfrom
MatmaRex:main
Open

Assert: Return error value from rejects() and throws()#1825
MatmaRex wants to merge 1 commit intoqunitjs:mainfrom
MatmaRex:main

Conversation

@MatmaRex
Copy link
Copy Markdown

@MatmaRex MatmaRex commented May 2, 2026

It permits a more natural way of asserting complex facts about the rejection value (thrown value) than the existing options of sticking assertions inside the expectedMatcher or writing your own try…catch blocks.

Fixes #1824.

It permits a more natural way of asserting complex facts
about the rejection value (thrown value) than the existing
options of sticking assertions inside the `expectedMatcher`
or writing your own try…catch blocks.

Fixes qunitjs#1824.
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 2, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: MatmaRex / name: Bartosz Dziewoński (9f3e398)

@MatmaRex
Copy link
Copy Markdown
Author

MatmaRex commented May 2, 2026

I saw those errors locally too:


/home/runner/work/qunit/qunit/src/core/dump.js
  225:23  error  Map is not supported in iOS Safari 7.0-7.1, IE 9  compat/compat

/home/runner/work/qunit/qunit/src/core/utilities.js
  26:22  error  Array.includes() is not supported in iOS Safari 7.0-7.1, IE 9  compat/compat

They don't seem to be my fault.

@Krinkle
Copy link
Copy Markdown
Member

Krinkle commented May 2, 2026

Two CI issues:

  1. A warning about array.includes from eslint-plugin-compat that was not previously found. This is techically correct, but not appplicable to us because we already check it beforehand. I'll fix this in the main branch with an ignore rule.
  2. A warning about Map from an eslint-plugin-compat indirect update. This is incorrect and an upstream regression. I've reported this at False positives: local variables/parameters matching browser API names are flagged amilajack/eslint-plugin-compat#688, and will likewise temporarily work around it for now.

@Krinkle Krinkle closed this May 2, 2026
@Krinkle Krinkle reopened this May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

It would be convenient if assert.rejects() and assert.throws() returned the error value

2 participants