-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
I believe this is a bug
Current Behavior
Regression in 20.0.1. this is a fresh / empty object for every test. Values assigned to this in beforeEach are not accessible from tests.
I believe commit a9a322f introduced the regression.
Repro
describe('userContext', function() {
beforeEach(function() {
this.foo = 'bar';
});
test('is accessible', function() {
expect(this.foo).toEqual('bar');
});
});
Expected Behavior
values assigned to this in a beforeEach function should be accessible to test functions. (Similar to how Jasmine works). This change is breaking the tests I recently migrated from Jasmine.
Versions, etc
Broken for Jest 20.0.4. Working for my yarn.lock that uses Jest 20.0.0.
Using yarn 0.24.6 on OSX Sierra.
emilgoldsmith
Metadata
Metadata
Assignees
Labels
No labels