Just wondering how beforeEach
works when you have nested functional tests in intern using the object
interface. For example
registerSuite({
name: 'Before Each Test Suite',
beforeEach: function () {
// parent beforeEach
},
'test one': function () {},
'inner suite': {
beforeEach: function () {
// nested beforeEach
},
'test two': function () {},
'test three': function () {}
}
});
In this scenario I would expect the parent beforeEach
to be called three times (once for each test) and the nested beforeEach
to be called twice. However, in my testing, it appears that the parent beforeEach
is only called twice. Once for test one
and only once for inner suite
. Am I missing something or is this the expected behavior?
This is expected behaviour, but it will change in the future since nobody else seems to expect it. See: https://github.com/theintern/intern/issues/67