Open chmac opened 9 years ago
Did you try to write it in a seperate file without using descibe
or it
?
Basecally this should do the job:
if (typeof MochaWeb !== "undefined" && MochaWeb !== null) {
MochaWeb.testOnly(function() {
beforeEach(function() {
console.log('everytime');
});
});
}
Is that for testing the app, or for testing packages? I'm running the packageTest
branch and testing my packages using mocha. I don't think the MochaWeb
variable is used for package testing, but I could well be wrong...
Firstly, thanks for the awesome packageTest branch. It's absolutely fantastic. To be running mocha tests inside our packages is a dream compared to slogging through tinytest. Fabulous.
In my never ending quest for optimisation, I spent far too many hours today trying to figure out how to declare a global
beforeEach
,before
,afterEach
and / orafter
. I'm pulling in sinon and would like to wrap some sinon sandboxing stuff around mocha. But for the life of me I cannot find a globalbeforeEach
hook.I've tried reading this codebase, tried
global.beforeEach()
and countless other ideas, but no dice.If it is possible, or if you have any pointers as to where I might continue my search, I'd be most grateful. Again, really, thanks for this package, mocha + meteor packages = deeply awesome!