theintern/intern

Add a `globals` option to configure automatically installed globals

jason0x43 opened this issue · 1 comments

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"
  ]
}

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