tdd and bdd interface types should disallow async suite declarations
jason0x43 opened this issue · 0 comments
jason0x43 commented
tl;dr Intern's typings allow async functions to be used as suite factories, but they don't work. They probably shouldn't work since they'd break focused testing support (#514), so the typings should be fixed.
Currently a suite with an async callback will build, but it won't run:
describe('something', async () => {
await Promise.resolve();
test('should do something', () => {
// ...
});
});
When a suite like this is executed, Intern 4.x will fail:
TOTAL: tested 1 platforms, 0 passed, 0 failed
Unhandled rejection: Error: A test must be declared within a suite
...
(ノಠ益ಠ)ノ彡┻━┻
Error: A test must be declared within a suite
...
The typings should explicitly prevent async callbacks from being used in suite declarations.