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

.throws feedback is not clear enough #3361

Open
thoughtsunificator opened this issue Dec 19, 2024 · 3 comments
Open

.throws feedback is not clear enough #3361

thoughtsunificator opened this issue Dec 19, 2024 · 3 comments

Comments

@thoughtsunificator
Copy link
Contributor

Please provide details about:

  • What you're trying to do

Assuming:

  • Node v23.1.0 (Linux)
  • "ava": "^6.2.0" and
  • no configuration
  • the following test file:
import ava from "ava"

ava("KO", test => {
  test.throws(() => {
  })
})
  • What happened

Running the test file (npm test) result in the following feedback:

  ✘ [fail]: KO
  ─

  KO

  foo.test.js:4

   3: ava("KO", test => {  
   4:   test.throws(() => {
   5:   })                 

  Function returned:

  undefined

  › file://foo.test.js:4:8

  ─

  1 test failed
  • What you expected to happen

A more concise message explaining that the function should have thrown something.

@novemberborn
Copy link
Member

Happy for a PR to tweak the “Function returned” copy. Perhaps “Function did not throw, instead returned”?

@thoughtsunificator
Copy link
Contributor Author

thoughtsunificator commented Dec 23, 2024

I'd say something along the lines of "The following assertion was expecting an error to be thrown" ? Maybe specify which type of error also.

@novemberborn
Copy link
Member

I wonder if that's a larger change across all assertions?

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

No branches or pull requests

2 participants