Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions test/js/node/net/server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,14 @@ describe("net.Server", () => {

describe("net.Server.prototype", () => {
it("has the expected methods", () => {
expect(net.Server.prototype).toMatchObject(
expect.objectContaining({
address: expect.any(Function),
close: expect.any(Function),
getConnections: expect.any(Function),
listen: expect.any(Function),
ref: expect.any(Function),
unref: expect.any(Function),
}),
);
expect(net.Server.prototype).toMatchObject({
address: expect.any(Function),
close: expect.any(Function),
getConnections: expect.any(Function),
listen: expect.any(Function),
ref: expect.any(Function),
unref: expect.any(Function),
});
});

it("is disposable", () => {
Expand Down
10 changes: 5 additions & 5 deletions test/js/node/url/url-parse-ipv6.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ describe("Valid spot checks", () => {
it.each([
// ports
["http://[::1]:", { host: "[::1]", hostname: "::1", port: null, path: "/", href: "http://[::1]/" }], // trailing colons are ignored
["http://[::1]:1", { host: "[::1]", hostname: "::1", port: "1", path: "/", href: "http://[::1]/" }],
["http://[::1]:1", { host: "[::1]:1", hostname: "::1", port: "1", path: "/", href: "http://[::1]:1/" }],

// unicast
["http://[::0]", { host: "[::0]", path: "/" }],
["http://[::f]", { host: "[::f]", path: "/" }],
["http://[::F]", { host: "[::F]", path: "/" }],
["http://[::F]", { host: "[::f]", path: "/" }], // the host is lowercased
// these are technically invalid unicast addresses but url.parse allows them
["http://[::7]", { host: "[::7]", path: "/" }],
// ["http://[::z]", { host: "[::7]", path: "/" }],
// ["http://[::😩]", { host: "[::😩]", path: "/" }],

// full form-ish
["https://[::1:2:3:4:5]", { host: "[::1:2:3:4:5]", path: "/" }],
["[0:0:0:1:2:3:4:5]", { host: "[0:0:0:1:2:3:4:5]", path: "/" }],
["[0:0:0:1:2:3:4:5]", { host: null, path: "[0:0:0:1:2:3:4:5]" }], // w/o a protocol, it's treated as a path
])("Parsing '%s' succeeds", (input, expected) => {
expect(url.parse(input)).toMatchObject(expect.objectContaining(expected));
expect(url.parse(input)).toMatchObject(expected);
});
}); // </Valid spot checks>

Expand Down Expand Up @@ -182,7 +182,7 @@ describe.each([

it("parses to the expected object", () => {
const { query, ...rest } = expected;
expect(parsed).toMatchObject(expect.objectContaining(rest));
expect(parsed).toMatchObject(rest);
});

it("parses the query", () => {
Expand Down
Loading