Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
How do i configure my jest tests correctly to stop after succeeding

When i execute my jest tests they succeed but don't stop. For example i have this test:

const request = require('supertest')
let app = require('../index')

describe('make workflow tests work', () => {
  test('Status code 200 for relayer', async () => {
    const response = await request(app).get('/')
    expect(response.statusCode).toBe(200)
  })
})

In my app i just have a basic endpoint that returns 200.

app.get('/', function (req, res) {
  res.send('200')
})

And some async jobs that run all the time:

;(async () => {
while (1) {
 console.log("i am active the whole time")
}})()
})

Now the problem i have is that the test dont stop after succeeding i get the message:

PASS tests/workflow.test.js (8.359 s)

● Cannot log after tests are done. Did you forget to wait for something async in your test?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!