Skip to content

beforeEach hook issue #3359

Discussion options

You must be logged in to vote

This modifies a global value (Foo.prototype.bar.constructor.prototype, being Function.prototype):

https://github.com/thoughtsunificator/avajs-before-each-hook-issue/blob/f857788c6416947cd1e193cbd6e7d5b9ce57032e/src/foo.js#L6

Even if hooks and tests are synchronous functions, hooks and tests may interleave (have not looked at the exact logic). So what this means is when the tests run, the mock value will be of the last instantiated Foo, not the foo object from the execution context.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thoughtsunificator
Comment options

Answer selected by thoughtsunificator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #3356 on November 25, 2024 14:00.