Fix end() not called when app is started manually#651
Fix end() not called when app is started manually#651nunofgs wants to merge 1 commit intoforwardemail:masterfrom
end() not called when app is started manually#651Conversation
|
🎉 This should now be resolved, please upgrade to the latest versions of
🔋 Maintenance supported by Forward Email (@forwardemail) at https://forwardemail.net |
Hey, just wanted to provide some feedback on this change. we had a few test suites which broke when we updated to the latest let server;
beforeAll(async () => {
server = app.listen(0);
await events.once(server, 'listening');
});
afterAll(async () => {
if (server) {
await util.promisify(server.close.bind(server)();
}
});
// a few tests that use serverPreviously ⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/someTest.js > test name
Error: Server is not running.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Test Files 1 failed | 6 passed (7)
Tests 74 passed (74)
Start at 14:45:40
Duration 2.42s (transform 196ms, setup 0ms, collect 2.19s, tests 1.66s, environment 2ms, prepare 3.70s)
ELIFECYCLE Command failed with exit code 1.We tracked down that failure to this change. In my opinion, |
|
You are correct, let me fix. |
|
Fixed. All tests are passing https://github.com/forwardemail/supertest/releases/tag/v7.1.3 I've already deprecated v7.1.2 as well since it had that backwards incompatible issue and was a patch bump not major |
Supertest supports passing previously-started apps, ie:
However, when used this way, the server was never called with
end().Note: tests are not passing but not due to this change (already failing in
master).Fixes #634