Mocha beforeEach vs before execution
问题 I ran into a problem recently that I can't explain. I have alot of code in these tests so I'm going to do my best to capture the idea here I have tests that look like: describe('main page', function(){ beforeEach(function(done){ addUserToMongoDb(done); // #1 }); afterEach(function(done){ removeUserFromMongoDb(done); }); context('login', function(){ it('should log the user in, function(){ logUserIn(user_email); // #2 - This line requires the user from the beforeEach }); }); context(