Skip to content

The --test-global-setup flag is silently ignored #82

Description

@piotr-cz

I use global global setup and teardown in my tests to load environment variables from multiple files like so:

node --test --test-global-setup ./test/setup.ts ./test/app.test.ts

However I'm not able to set this flag in this extension.
It's silently ignored, even when passing invalid path (in that case native Node.js test runner throws Error [ERR_MODULE_NOT_FOUND]).

I've tried:

{
  "nodejs-testing.nodejsParameters": [
    // None of these work
    "--test-global-setup", "${workspaceFolder}/test/setup.ts",
    "--test-global-setup=${workspaceFolder}/test/setup.ts"
    "--test-global-setup ${workspaceFolder}/test/setup.ts"
  ],
}

and

{
  "nodejs-testing.extensions": [
    {
      "extensions": ["test.ts"],
      "parameters": [
        // None of these work
        "--test-global-setup", "./test/setup.ts",
        "--test-global-setup=./test/setup.ts",
        "--test-global-setup ./test/setup.ts"
      ]
    }
  ]
}

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions