Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a globals option to configure automatically installed globals #1139

Open
jason0x43 opened this issue Apr 14, 2020 · 1 comment
Open

Add a globals option to configure automatically installed globals #1139

jason0x43 opened this issue Apr 14, 2020 · 1 comment
Labels
effort-medium This may take a couple of days enhancement A new or improved feature needs-opinions Needs opinions to decide how to handle

Comments

@jason0x43
Copy link
Member

Allow test interfaces and assertions to be added to the global namespace, making testing writing simpler.

By default, the only thing added to the global space should be the existing intern object.

A globals config option should allow the user to specify one of the built-in interfaces and/or one of the built-in assertion modules to be added to the global namespace.

{
  "globals": {
    "interface": "bdd",
    "assertions": "expect"
  }
}

To support typing, .d.ts files should be added to a globals directory in the intern package that declare these globals. A tsconfig could then include relevant ones:

{
  "files": [
    "node_modules/intern/globals/bdd.d.ts"
  ]
}
@jason0x43 jason0x43 added enhancement A new or improved feature effort-medium This may take a couple of days priority-high Most important labels Apr 14, 2020
@jason0x43 jason0x43 removed the priority-high Most important label Apr 14, 2020
@jason0x43 jason0x43 added the needs-opinions Needs opinions to decide how to handle label Apr 14, 2020
@jason0x43
Copy link
Member Author

Let's see how well the simplified imports (#1120) work before adding globals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort-medium This may take a couple of days enhancement A new or improved feature needs-opinions Needs opinions to decide how to handle
Projects
None yet
Development

No branches or pull requests

1 participant