You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
Right now it looks like each test gets a unique context (e.g. this). But the context should be shared by the before() and after() methods. This enables you to set up test-specific state and clean it up without polluting each actual test or polluting the closure scope. See example.
describe('testing the context', function() {
before(function() {
this.foo = 'unit';
});
after(function() {
this.foo = null;
});
it('should have the context set', function() {
expect(this.foo).to(be, 'unit');
});
});
The test context should probably be cleared out after each test too. e.g. all properties set to null.
The text was updated successfully, but these errors were encountered:
Right now it looks like each test gets a unique context (e.g.
this
). But the context should be shared by thebefore()
andafter()
methods. This enables you to set up test-specific state and clean it up without polluting each actual test or polluting the closure scope. See example.The test context should probably be cleared out after each test too. e.g. all properties set to null.
The text was updated successfully, but these errors were encountered: