Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

favor the constructor of the performance instance if it exists #478

Conversation

zbyte64
Copy link
Contributor

@zbyte64 zbyte64 commented Aug 12, 2023

Purpose

Fix issue #420 by favoring the constructor of the performance instance over the Performance class

Background

jsdom also patches the Performance class and doesn't implement all of the methods.

I could not use the workaround mentioned: #394 (comment) because I'm using vitest with jsdom as the environment.

Solution

This simply favors the prototype of the performance instance, since that seems to be untouched by jsdom.

@codecov
Copy link

codecov bot commented Aug 13, 2023

Codecov Report

Patch coverage: 50.00% and no project coverage change.

Comparison is base (b568150) 96.47% compared to head (4982ed0) 96.47%.

❗ Current head 4982ed0 differs from pull request most recent head 0fdc0ad. Consider uploading reports for the commit 0fdc0ad to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #478   +/-   ##
=======================================
  Coverage   96.47%   96.47%           
=======================================
  Files           2        2           
  Lines         680      680           
=======================================
  Hits          656      656           
  Misses         24       24           
Flag Coverage Δ
unit 96.47% <50.00%> (ø)

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

Files Changed Coverage Δ
src/fake-timers-src.js 96.49% <50.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fatso83 fatso83 merged commit 20eaca1 into sinonjs:main Aug 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants