Skip to content

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

@piotr-cz

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

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