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?