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

Test scripts in package.json fail on Windows #568

Open
geographika opened this issue Jul 13, 2024 · 0 comments
Open

Test scripts in package.json fail on Windows #568

geographika opened this issue Jul 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@geographika
Copy link

Bug

Describe the bug

On Windows running the test scripts in package.json fail as setting the environment variables only works on Linux:

    "test-debug": "NODE_OPTIONS=--import=extensionless/register vitest --inspect-brk --no-file-parallelism",
    "test-watch": "NODE_OPTIONS=--import=extensionless/register vitest",
    "test": "NODE_OPTIONS=--import=extensionless/register vitest run

https://github.com/geostyler/geostyler-qgis-parser/blob/23679aea86c6cf63517f3697422f20db0204c2ef/package.json#L46C1-L48C70

For example:

npm run test-debug

> [email protected] test-debug
> NODE_OPTIONS=--import=extensionless/register vitest --inspect-brk --no-file-parallelism

'NODE_OPTIONS' is not recognized as an internal or external command,
operable program or batch file.

One previous suggestion was to use cross-env:

npm install cross-env
# in package.json you then need to use:
    "test": "cross-env NODE_OPTIONS=--import=extensionless/register vitest run"

This approach still works but this now an archived project. Any ideas on a cleaner long-term solution?

@geographika geographika added the bug Something isn't working label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants