Skip to content

Instantly share code, notes, and snippets.

@todgru
Last active June 27, 2022 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todgru/9d2458b580fc5eccde233d0e88e1686d to your computer and use it in GitHub Desktop.
Save todgru/9d2458b580fc5eccde233d0e88e1686d to your computer and use it in GitHub Desktop.
ava avajs assertionerror global npx

Running tests using the globaly installed ava@4.x produces this error:

$ ava test.js

  Uncaught exception in test.js

  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

    assert(refs.runnerChain)

This is not a VSCode issue, but this thread was useful and inspired the use of npx.

Fix: Instead of the globally installed version of ava, use npx ava test.js to run test.

$ npx ava test.js

✔ mytest › some test (10ms)
@todgru
Copy link
Author

todgru commented Jun 27, 2022

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