Skip to content

kit: uvu test pattern is incorrect (especially on Windows) #401

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

Closed
GrygrFlzr opened this issue Feb 21, 2021 · 0 comments · Fixed by #402
Closed

kit: uvu test pattern is incorrect (especially on Windows) #401

GrygrFlzr opened this issue Feb 21, 2021 · 0 comments · Fixed by #402

Comments

@GrygrFlzr
Copy link
Member

Describe the bug
Currently, the test pattern used is as follows:

"test": "uvu src \"(spec.mjs|test/index.mjs)\""

There are two issues:

  • The dots here are not literals as they have not been escaped, they represent "any character".
    For example, any file with a specxmjs extension would match.
  • On Windows, test/index.mjs does not correctly locate integration tests. I can see on the github CI it at least works with the Linux system, though.
    image

To Reproduce
pnpm test on a Windows system

Expected behavior
Run all tests.

Severity
Since the CI currently runs Linux anyway, core tests won't be missed, but as Windows-related contributions get added and access to the Windows CI becomes available, this will lead to tests being skipped and falsely reporting success on Windows.

Solution

{
  "test": "uvu src \"(spec\\.mjs|test/index\\.mjs|test\\\\index\\.mjs)\""
}

image

Will submit as a PR. Let me know if I'm missing something obvious with this change. Other than the fact it looks really ugly because we have to escape the pattern escapes to be valid JSON.

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

Successfully merging a pull request may close this issue.

1 participant