Skip to content
This repository was archived by the owner on Dec 27, 2018. It is now read-only.

Fix the 'this' context that is passed to mocha functions to be compat… #10

Open
wants to merge 1 commit into
base: practicalmeteor
Choose a base branch
from

Conversation

yossarian21
Copy link

…ible with Mocha's Shared Behaviors features: https://github.com/mochajs/mocha/wiki/Shared-Behaviours.

This allows setups like this to work; this works on client but not on server before the fix:
helpers.js:
beforeEach(function () { this.sandbox = sinon.sandbox.create(); }); afterEach(function () { this.sandbox.restore(); });

myTests.js:
describe('some module', function () { it('has a sandbox', function () { expect(this.sandbox).to.be.ok; } });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant