mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
tests: hook process.send instead of server/started
This commit is contained in:
1 parent
d8319cb9b0
commit
aab5b2211f
2 files changed
+6
-1
No files matched your search
+4
-1
@@ -20,7 +20,10 @@ describe('App', () => {
|
||||
agent = supertest.agent(require('hydrooj/src/service/server').httpServer);
|
||||
done();
|
||||
}, 2000);
|
||||
bus.on('app/started', resolve);
|
||||
process.send = ((send) => (data) => {
|
||||
if (data === 'ready') resolve();
|
||||
return send?.(data) || false;
|
||||
})(process.send);
|
||||
timeout = setTimeout(resolve, 20000);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user