Comments (8)
This is just inherited from the Node.js assert
module.
Can you bring this up on the Node.js issue tracker first?
That assert method is pretty irrelvant with promises though.
from ava.
I see, but looking at the assert
documentation it states that ifError
"throws value if value is truthy".
If I got that right I think AVA's ifError
is inverted. It throws the value if it's falsy.
from ava.
Can you write a quick test case @alebelcor?
from ava.
@Qix- ava have test case for this.
@alebelcor judging by test case ifError
behaves correctly (throws, if value
is truthy - double negative is always tough, thou).
from ava.
OK, then (unless I'm mistaken) this just means that the readme.md
is inaccurate.
It should read:
.ifError(error, [message])
Asserts that error is truthy.
from ava.
Asserts that error is truthy.
Well, no. It asserts that error is falsy. It throws if error is truthy.
from ava.
@alebelcor If you have any good suggestions for a better name we might consider adding an alias, but I don't really care much tbh, as the future is promises and async functions which makes this assert method moot.
from ava.
Related: nodejs/node#3398
from ava.
Related Issues (20)
- The watch mode does not work in v6 HOT 4
- Ability to run a mixed test code base using node:test HOT 2
- Azure DevOps output handler
- Typescript with VS Code debug issue
- config to control handling for tests that 'Failed to exit' - v6+ issue HOT 3
- Ava fails to run in watch mode via CLI HOT 2
- Documentation Request: Using a Node Custom Loader
- Add support for `--env-file=` flag for node 20 in `nodeArguments`
- Spurious "previous failures in test files that were not rerun" in watch mode HOT 2
- registerCompletionHandler can't be used in CommonJS project HOT 1
- Allow regexes in `t.like` HOT 4
- failing async test ends in timeout instead of go to catch clause
- `t.throws` doesn't recognize falsy thrown values
- `t.inRange`
- Ava won't work with yarn workspaces package named `business-logic` HOT 1
- Tap reporter outputs internal stack traces HOT 2
- Add support for Node 22 HOT 4
- [tap, @vercel/nft, xo, @ava/test, c8] Some internal modules are deprecated. HOT 1
- timeouts with testcontainers HOT 1
- Allow ignoring a resolved configuration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ava.