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

Ensure test after() callback is always executed #3936

Merged
merged 2 commits into from Jan 26, 2021

Conversation

Benjamin-Dobell
Copy link
Contributor

@Benjamin-Dobell Benjamin-Dobell commented Jan 25, 2021

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?
N/A - The fix is for the test suite itself.

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

Took me a little while to track down what was going on here. Basically, if the emit-uint8array-no-buffer test fails, then all subsequent tests will fail to execute. This is because the emit-uint8array-no-buffer test has a before function which deletes global.Buffer, and and an after function which is supposed to restore it.

However, prior to this PR, the after callback is not guaranteed to be called so global.Buffer remains undefined. The lack of global.Buffer causes issues with, magic-string, but likely elsewhere too.

before() {
delete global.Buffer;
},
after() {
global.Buffer = Buffer;
},

@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #3936 (3cf9cbc) into master (889fa52) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3936   +/-   ##
=======================================
  Coverage   97.18%   97.18%           
=======================================
  Files         188      188           
  Lines        6681     6681           
  Branches     1944     1944           
=======================================
  Hits         6493     6493           
  Misses         99       99           
  Partials       89       89           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13489b9...5a7cebc. Read the comment docs.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@lukastaegert lukastaegert merged commit 45d1ec2 into rollup:master Jan 26, 2021
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.

None yet

2 participants