mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +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
@@ -44,6 +44,7 @@
|
||||
"nodemailer": "^6.7.5",
|
||||
"notp": "^2.0.3",
|
||||
"p-queue": "^7.2.0",
|
||||
"path-to-regexp": "^6.2.1",
|
||||
"require-resolve-hook": "^1.1.0",
|
||||
"semver": "^7.3.7",
|
||||
"serialize-javascript": "^6.0.0",
|
||||
@@ -67,6 +68,7 @@
|
||||
"@types/mongodb": "^3.6.20",
|
||||
"@types/nodemailer": "^6.4.4",
|
||||
"@types/notp": "^2.0.2",
|
||||
"@types/path-to-regexp": "^1.7.0",
|
||||
"@types/semver": "^7.3.10",
|
||||
"@types/serialize-javascript": "^5.0.2",
|
||||
"@types/source-map-support": "^0.5.4",
|
||||
|
||||
+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