'Test finished without running any assertions' with Ava
See original GitHub issueI’m new to supertest, so I’m not sure I’m doing something wrong…
I’m using Ava and I have the following test case:
test('Get thirdPartyMedia By Id', async t => {
const id = String(dbFixtures.valid.thirdPartyMedia._id)
await request(app)
.get(`/third-party-media/${id}`)
.expect(200)
})
Notice: app
is set on before
hook.
The request is triggered properly and the response is what I expected, however, I get the following error:
Test finished without running any assertions
If I change the expected status code to any other value, the test fails as expected.
Environment info
- Node: 6.11.2
- Ava: 0.21.0
- Supertest: 3.0.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
'Test finished without running any assertions' with Ava #432
Ava considers no assertion present in a test an error. But the assertion is being performed. I use other libraries with Ava that...
Read more >Test finished without running any assertion (ava-nodejs)
If i run this code on server everything works properly. test.serial('test with req' , async (assert) => { var promise = ...
Read more >Test Finished Without Running Any Assertion Avanodejs
Ava considers no assertion present in a test an error.But the assertion is being performed.I use other libraries with Ava that are. AVA...
Read more >How you can test your Node.js applications with Ava.js - Medium
Ava is a JavaScript test runner. It utilizes the async I/O nature of Node and runs concurrent tests, thereby vastly decreasing your test...
Read more >clutch-assert - npm
Start using clutch-assert in your project by running `npm i clutch-assert`. There are no other projects in the npm registry using clutch-assert.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve openned this issue because I didn’t understand by that time why
supertest
.expect()
syntax didn’t work withava
, as it is shorter.The file you pointed out was created on Aug 5, 2017, about 1 month before I created this issue. I can’t remember why I wasn’t able to find it at that time 😅.
Anyway you’re right, if the official
ava
docs state that there is a recommended way, I should stick to it.Thank’s a lot @havenchyk
Also, now I remember I did find out that
testdouble
had the same issue when working withava
, so this is definitely not asupertest
specific issue.well,
t.pass()
isn’t better IMHO. Here is a recommended way that is described in ava docs.Anyway, I don’t see how this issue can be addressed in this repository