describe('The app', function() {
beforeEach(function() {
login();
});
it('does the feature1 right', function() {
// assertions
});
afterEach(function() {
logout();
});
});
--
You received this message because you are subscribed to a topic in the Google Groups "Mocha" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mochajs/p0B8h4nfooc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mochajs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[chrome #0-0] Session ID:[chrome #0-0] Spec: C:\Users\iano\Repos\Web\specs\Portal\smokeTests\login.spec.js[chrome #0-0] Running: chrome[chrome #0-0][chrome #0-0] QA_Login[chrome #0-0] √ Screeners Login[chrome #0-0][chrome #0-0] QA_Smoke Tests for Login[chrome #0-0] √ C663811 Login with Valid Credentials/Multi-Portal User Selects Active Portal[chrome #0-0][chrome #0-0][chrome #0-0] 2 passing (38s)[chrome #0-0]Wrote json report to [./Reports].2 passing (40.90s)
describe('The app', function() {
beforeEach(function(login) {});
afterEach(function(logout) {
});it('does the feature1 right', function() {// assertions});
it('does the feature2 right', function() {// assertions});it('does the feature3 right', function() {// assertions});});
If you want it to be executed only once, before all the tests, you just replace the beforeEach with before. 🤓But if you really want it to be executed before every test, then yeah, this it is expected to see it more than once in the test report. 🤔
--