Skip to content

Commit 572af52

Browse files
committed
test(net): skip unavailable addresses through vitest's test context
1 parent 1aa7b02 commit 572af52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎lib/common/test/unit-tests/services/net-service.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe("net", () => {
3030
const hosts = [undefined, "127.0.0.1", "::1", "0.0.0.0", "::"];
3131

3232
for (const host of hosts) {
33-
it(`returns false for a port taken on ${host || "the default address"}`, async function () {
33+
it(`returns false for a port taken on ${host || "the default address"}`, async (context: any) => {
3434
const service = createTestInjector("darwin").resolve<INet>(Net);
3535
const server = net.createServer();
3636
const listening = await new Promise<boolean>((resolve) => {
@@ -39,7 +39,7 @@ describe("net", () => {
3939
host ? server.listen(0, host, onListening) : server.listen(0, onListening);
4040
});
4141
if (!listening) {
42-
this.skip();
42+
context.skip();
4343
return;
4444
}
4545
const { port } = <net.AddressInfo>server.address();

0 commit comments

Comments
 (0)