rustwasm / wasm-pack

📦✨ your favorite rust -> wasm workflow tool!
https://rustwasm.github.io/wasm-pack/
Apache License 2.0
6.27k stars 409 forks source link

`wasm-pack test` default output text can be hard to interpret #784

Open yoshuawuyts opened 4 years ago

yoshuawuyts commented 4 years ago

🐛 Bug description

When running wasm-pack test the following is printed to the screen:

Interactive browsers tests are now available at http://127.0.0.1:8000

Note that interactive mode is enabled because `NO_HEADLESS`
is specified in the environment of this process. Once you're
done with testing you'll need to kill this server with
Ctrl-C.

wasm-pack refers to a configuration NO_HEADLESS being specified as part of the environment. However I haven't specified any env flags which makes it a bit confusing to figure out where this is coming from. Also the double negative for the flag threw me off a bit: to enable headless mode we need to omit an env var we don't remember setting? That was my reading of the text, and it confused me.

🤔 Expected Behavior

Probably most people would want to run the tests in headless mode, which can be done through by passing --headless to wasm-pack test. Drawing people's attention to this in the copy might be helpful:

Interactive browsers tests are now available at http://127.0.0.1:8000

Note that headless mode can be enabled by passing the `--headless`
to `wasm-pack test`. Once you're done with testing you'll need to
kill this server with Ctrl-C.

👟 Steps to reproduce

This is one of the first pieces of copy users will see when running wasm-pack test.

🌍 Your environment

Include the relevant details of your environment. wasm-pack version: 0.9.0 rustc version: 1.41.0 os: windows

ashleygwilliams commented 4 years ago

thanks for filing @yoshuawuyts !! super agree with this- this error message actually exists in wasm-bindgen-test (https://github.com/rustwasm/wasm-bindgen/blob/935f71afecd9921d827acd64b8ea420dde947e01/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs#L162)

i believe the root of the issue is the error message is useful for users who are running wasm-bindgen test directly, but very few (maybe?) actually do. we should reconcile the error in that repo, or at the very least intercept it in wasm-pack and update it to the language you suggest. @fitzgen do you have any thoughts?