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

Another dumb question: How to run tests? #284

Closed
Lord-Kamina opened this issue Oct 19, 2022 · 2 comments
Closed

Another dumb question: How to run tests? #284

Lord-Kamina opened this issue Oct 19, 2022 · 2 comments

Comments

@Lord-Kamina
Copy link

I'm trying to run the tests on my computer so I can compare them with the port I'm doing and debug it because I'm experiencing some odd behavior on

[
    "/{apple-}?icon-:res(\\d+).png",
    undefined,
    [
      "/",
      {
        name: "",
        prefix: "apple-",
        suffix: "",
        modifier: "?",
        pattern: "",
      },
      "icon-",
      {
        name: "res",
        prefix: "",
        suffix: "",
        modifier: "",
        pattern: "\\d+",
      },
      ".png",
    ]

It's probably not a path2regex error but rather on the c++ library I'm working with. Still, test logs are expired on github and when I try to run tests, I get this error:

[~/path-to-regexp] $ ts-scripts test
> Running "eslint"...

~/path-to-regexp/src/index.spec.ts
  17:10  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

~/path-to-regexp/src/index.ts
  277:32  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

✖ 2 problems (0 errors, 2 warnings)

> Running "prettier"...
Checking formatting...
All matched files use Prettier code style!
> Running "tsc --noEmit --project tsconfig.json"...
❌ Unable to resolve: vitest/vitest.mjs
@blakeembrey
Copy link
Member

You should be using NPM scripts, never a global module you've installed. The package you installed is a different version to the one this package depends on for tests. In this case, you can use npm test or npm specs (for just the tests without lint checks).

@Lord-Kamina
Copy link
Author

You should be using NPM scripts, never a global module you've installed. The package you installed is a different version to the one this package depends on for tests. In this case, you can use npm test or npm specs (for just the tests without lint checks).

I ended figuring it out. Yes, my node set-up is a raging mess. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants