Contemplate adding in isolation at the batch level #5

Closed
twolfson opened this Issue Mar 24, 2013 · 5 comments

1 participant

@twolfson
Owner

It is kind of sloppy of mocha to not isolate batches (even at the hookup/hookdown), do we want to instrument and tweak this to use a chain style?

@twolfson
Owner

It looks like there is a problem in doubleshot, not mocha, with respect to the top level batches. This test proves that mocha does not have cross-contamination.

https://github.com/twolfson/mocha/blob/8e11b56c94382dc7e6ec19a824f225ae734b362d/test/acceptance/batch.isolation.js

@twolfson
Owner

Cross contamination still exists but you need to be quite aggressive with your this fallbacks to get it.

https://github.com/twolfson/mocha/blob/04ea54bc7772fd103d63532dcb66c1a77d07d199/test/acceptance/batch.isolation.js

@twolfson
Owner

Arguing myself into this; it is necessary for modular code. We must enforce the module pattern at the batch level as it is expected behavior. If people try to break out, let them use the global scope on their own terms.

@twolfson twolfson added a commit that referenced this issue Jun 25, 2013
@twolfson Rough draft working which patches #5. Not sure this is ideal and stil…
…l second guessing against `mocha` not doing this
1f1660b
@twolfson
Owner

Released in 2.3.0.

@twolfson twolfson closed this Jun 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment