xicri / genshin-langdata

English-Chinese-Japanese translation dataset of the terms in Genshin Impact
https://genshin-dictionary.com
Other
25 stars 12 forks source link

Linux-style environment variables in npm scripts are not supported on Windows #189

Closed yasuking0304 closed 3 months ago

yasuking0304 commented 3 months ago

Problem

Currently, when I run test in a Windows environment, it fails.

Suggestion

If you introduce "cross-env", you will be able to execute test independently of the OS.

now package.json

  "scripts": {
    "test": "npm run build && NODE_OPTIONS=--experimental-vm-modules jest",

...

  "devDependencies": {
    "husky": "^8.0.3",
    "lint-staged": "^13.1.2"
  }

after

  "scripts": {
    "test": "npm run build && cross-env NODE_OPTIONS=--experimental-vm-modules jest",

...

  "devDependencies": {
    "cross-env": "^5.0.5",
    "husky": "^8.0.3",
    "lint-staged": "^13.1.2"
  }
xicri commented 3 months ago

So this time, I want to solve this problem by migrating to Vitest or using WSL.

xicri commented 3 months ago

Closing for now.

xicri commented 1 month ago

FYI. I have migrated from Jest to Vitest. Now the environment variable is removed from npm scripts and they should not cause syntax errors in most cases.