Skip to content

Commit 4e0a88a

Browse files
client test
1 parent 0783875 commit 4e0a88a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/engine.io-client/test/webtransport.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Http3Server, WebTransport } from "@fails-components/webtransport";
2-
import { Http3EventLoop } from "@fails-components/webtransport/lib/event-loop.js";
32
import expect from "expect.js";
43
import { Server } from "engine.io";
54
import { Socket } from "../build/esm-debug/index.js";
@@ -16,7 +15,7 @@ async function setup(opts, cb) {
1615
const certificate = await generateWebTransportCertificate(
1716
[{ shortName: "CN", value: "localhost" }],
1817
{
19-
days: 14, // the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements)
18+
days: 13, // the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements)
2019
},
2120
);
2221

@@ -48,7 +47,10 @@ async function setup(opts, cb) {
4847
})();
4948

5049
h3Server.startServer();
51-
h3Server.onServerListening = () => cb({ engine, h3Server, certificate });
50+
51+
await h3Server.ready;
52+
53+
cb({ engine, h3Server, certificate });
5254
}
5355

5456
function success(engine, h3server, done) {
@@ -79,10 +81,6 @@ function createSocket(port, certificate, opts) {
7981
}
8082

8183
describe("WebTransport", () => {
82-
after(() => {
83-
Http3EventLoop.globalLoop.shutdownEventLoop(); // manually shutdown the event loop, instead of waiting 20s
84-
});
85-
8684
it("should allow to connect with WebTransport directly", (done) => {
8785
setup({}, ({ engine, h3Server, certificate }) => {
8886
const socket = createSocket(h3Server.port, certificate, {

0 commit comments

Comments
 (0)