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

node --test ./tests/*.js has inconsistent behaviors in unix and windows #47863

Closed
hyf0 opened this issue May 4, 2023 · 1 comment
Closed

Comments

@hyf0
Copy link

hyf0 commented May 4, 2023

Version

v18.16.0

Platform

Microsoft Windows NT 10.0.22621.0 x64

Subsystem

No response

What steps will reproduce the bug?

  1. Clone https://github.com/hyf0/starter-libesm
  2. Run pnpm test:defult or node --test ./tests/*.js both on unix and windows

Unix output

> [email protected] test /home/runner/work/starter-libesm/starter-libesm
> node --test ./tests/*.js

TAP version 13
# Subtest: /home/runner/work/starter-libesm/starter-libesm/tests/index.js
ok 1 - /home/runner/work/starter-libesm/starter-libesm/tests/index.js
  ---
  duration_ms: [8](https://github.com/hyf0/starter-libesm/actions/runs/4885416970/jobs/8719448063#step:7:9)0.4[17](https://github.com/hyf0/starter-libesm/actions/runs/4885416970/jobs/8719448063#step:7:18)502
  ...
1..1
# tests 1
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 85.08817

windows output

Run pnpm test

> [email protected] test D:\a\starter-libesm\starter-libesm
> node --test ./tests/*.js

Could not find 'D:\a\starter-libesm\starter-libesm\tests\*.js'
 ELIFECYCLE  Test failed. See above for more details.
Error: Process completed with exit code 1.

Using node --test .\\tests\\*.js on windows also fails.

output:

Could not find 'C:\Users\xxx\Documents\GitHub\starter-libesm\tests\*.js'

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

See above.

Additional information

No response

@cjihrig
Copy link
Contributor

cjihrig commented May 4, 2023

The pattern passed after --test is evaluated by the shell, not by Node.js, which is why you're seeing differences between Unix and Windows. There is work in progress to support passing globs to the test runner, which you can follow in #47653. I'm going to close this as working as expected.

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