jmlue42 / spectral-jsonapi-ruleset

A Stoplight/Spectral linting ruleset for the JSON:API specification.
MIT License
12 stars 8 forks source link

Tests do not work on Windows (with potential solution) #75

Open DawMatt opened 7 months ago

DawMatt commented 7 months ago

The current npm test results in the following when executing on Windows:

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

Changing the current scripts from:

  "scripts": {
    "test": "./node_modules/.bin/spectral lint examples/valid/* -r ./.spectral.yml",
    "prepare": "husky install"
  },

to

  "scripts": {
    "test": "spectral lint examples/valid/* -r ./.spectral.yml",
    "prepare": "husky install"
  },

fixes the problem on Windows. I'm currently unable to test this on Unix right now, but believe this should also work there as ./node_modules/.bin is apparently added to the start of the PATH by node or npm.

Note: I haven't PRed this as I need someone to verify it won't break compatibility on other platforms first.

DawMatt commented 7 months ago

OK, I've now managed to successfully test this change on a Mac. Will submit the change via PR.