Skip to content

Commit

Permalink
test: skip invalid host tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 6, 2023
1 parent 2c04d70 commit e8b92ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { describe, test, expect, afterEach } from "vitest";
import { getPort } from "../src";
import { blockPort } from "./utils";

const isWindows = process.platform === "win32"

describe("getPort ()", () => {
describe("checks ports on default host`", () => {
let portBlocker: Server;
Expand Down Expand Up @@ -92,7 +94,7 @@ describe("errors", () => {
);
});

test("unavailable hostname", async () => {
test.skipIf(isWindows)("unavailable hostname", async () => {
const error = await getPort({
host: "192.168.1.999",
}).catch((error) => error);
Expand All @@ -101,7 +103,7 @@ describe("errors", () => {
);
});

test("unavailable hostname (no random)", async () => {
test.skipIf(isWindows)("unavailable hostname (no random)", async () => {
const error = await getPort({
host: "192.168.1.999",
random: false,
Expand Down

0 comments on commit e8b92ac

Please sign in to comment.