Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue about the setTimeout() on tests section #2248

Open
2 tasks done
henda466 opened this issue May 6, 2024 · 0 comments
Open
2 tasks done

issue about the setTimeout() on tests section #2248

henda466 opened this issue May 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@henda466
Copy link

henda466 commented May 6, 2024

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

An exception thrown when adding a function with setTimeout on the tests section :


Function


test("res.status should be 200", function(done) {
const data = res.getBody();
expect(res.getStatus()).to.equal(200);
setTimeout(function() {
done();
}, 1000); // Ajoutez un délai de 1 seconde avant de terminer le test
});

test("res.body should be correct", function(done) {
let data = res.getBody();
let productWithContractType = data.find(product =>
product.productOffering && product.productOffering["@type"] === "Contract"
);
if (productWithContractType) {
console.log("Product ID with productOffering @type 'Contract':", productWithContractType.operationalStatus);
expect(productWithContractType.operationalStatus).to.equal('Confirmed');
}
setTimeout(function() {
done();
}, 2000); // Ajoutez un délai de 2 secondes avant de terminer le test
});

.bru file to reproduce the bug

No response

Screenshots/Live demo link

Capture d’écran 2024-05-06 110718

@henda466 henda466 added the bug Something isn't working label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant