question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Test finished without running any assertions' with Ava

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
hbarceloscommented, Nov 6, 2018

I’ve openned this issue because I didn’t understand by that time why supertest .expect() syntax didn’t work with ava, 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 with ava, so this is definitely not a supertest specific issue.

1reaction
havenchykcommented, Nov 6, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found