Skip to content

Enumerate the possible jsdomError.type strings #3596

Description

@joeframbach

Basic info:

  • Node.js version: N/A
  • jsdom version: latest

Minimal reproduction case

const { VirtualConsole } = require("jsdom");

const virtualConsole = new VirtualConsole();

virtualConsole.on("jsdomError", error => {
  if (error.type === "this error type doesn't exist") {
    console.log("Typescript should warn me here!");
  }
});

I filed a PR with @types/jsdom at DefinitelyTyped/DefinitelyTyped#66630. I would like the jsdom team to take a look and discuss how we can better enumerate the jsdomError types. In my PR I note "There is no single enumeration of error type strings. It is not clear if jsdom considers this part of a stable API surface." Please give commentary on this. Are the strings going to be "stable" within a non-major version bump? It's not part of the API surface and not defined in DefinitelyTyped, so it is not guaranteed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAn issue with the JSDOM API, instead of the web platformmetr upliftA candidate for the METR Uplift experiment

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions