Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

beforeEach/afterEach hooks in nested suites #8

Closed
kuraga opened this issue Sep 16, 2018 · 4 comments
Closed

beforeEach/afterEach hooks in nested suites #8

kuraga opened this issue Sep 16, 2018 · 4 comments

Comments

@kuraga
Copy link

kuraga commented Sep 16, 2018

Hello, @zensh !

I see that beforeEach/afterEach hooks don't affect all nested tests but only this layer's tman.test and tman.suite:

import tman from 'tman';

tman.suite('suite-1', function () {
  tman.beforeEach(function () {
    console.log(1);
  });
  tman.suite('suite-2', function () {
    tman.test('A', function () {
    });
    tman.test('B', function () {
    });
  });
  tman.suite('.state', function () {
    tman.test('C', function () {
    });
    tman.test('D', function () {
    });
  });
});
  ✢ suite-1
1
    ✢ suite-2
      ✓ A
      ✓ B
1
    ✢ .state
      ✓ C
      ✓ D

Is it a bug or a feature?

Thanks.

@zensh
Copy link
Member

zensh commented Sep 18, 2018

Yes, it a feature!

@zensh zensh closed this as completed Sep 18, 2018
@kuraga
Copy link
Author

kuraga commented Sep 18, 2018

@zensh do you know that's Mocha-incompatible feature? :)

@zensh
Copy link
Member

zensh commented Sep 18, 2018

@kuraga you can try --mocha option

@kuraga
Copy link
Author

kuraga commented Sep 18, 2018

Hm. Really. Thanks!

So, did you introduce this yourself? Interesting :)

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

No branches or pull requests

2 participants