Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Jan 23, 2025
1 parent 61e4084 commit 0fb82ea
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/js/node/url/url.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { bunRunAsScript, bunRun, tempDirWithFiles } from "harness";
import path from "path";
import { parse } from "url";

describe("Url.prototype.parse", () => {
Expand Down Expand Up @@ -79,3 +81,18 @@ it("URL constructor throws ERR_MISSING_ARGS", () => {
// @ts-expect-error
expect(err?.code).toEqual("ERR_MISSING_ARGS");
});

describe("url.parse()", () => {
it("respects process.noDeprecation", () => {
const dir = tempDirWithFiles("url-parse", {
"index.js": `
process.noDeprecation = true;
const { parse } = require("url");
parse("http://example.com");
`,
});

const { stderr } = bunRun(path.join(dir, "index.js"));
expect(stderr).toBeEmpty();
});
});

0 comments on commit 0fb82ea

Please sign in to comment.