testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.25k stars 463 forks source link

Use defineProperty on the error object instead of setting the message… #1261

Closed julienw closed 10 months ago

julienw commented 10 months ago

… directly

Fixes #1259

What: Use defineProperty on the error object instead of setting the message directly (Fixes #1259)

Why: With a DOMException, the error isn't propagated properly without this fix.

How: I used defineProperty instead of setting the message property directly.

Checklist:

julienw commented 10 months ago

Thanks for the review! If it's not breaking, why isn't it possible to take it in a minor version ?

codesandbox-ci[bot] commented 10 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a0e916f815d8466c7abab90d1692ce303773d068:

Sandbox Source
react-testing-library-examples Configuration
codecov[bot] commented 10 months ago

Codecov Report

Merging #1261 (a0e916f) into main (07f5999) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #1261   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines         1038      1038           
  Branches       351       351           
=========================================
  Hits          1038      1038           
Flag Coverage Δ
node-14 100.00% <100.00%> (ø)
node-16 100.00% <100.00%> (ø)
node-18 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/wait-for.js 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

timdeschryver commented 10 months ago

Nevermind, scratch my previous comment @julienw . There was a workaround around our CI issue, which is resolved in #1262

timdeschryver commented 10 months ago

@all-contributors please add @julienw for code, bug

allcontributors[bot] commented 10 months ago

@timdeschryver

I've put up a pull request to add @julienw! :tada: