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.

Should `suite.run()` return a promise for the test results?

See original GitHub issue

So I am bundling my test suite using rollup to run it in the browser and since v0.3.1 that works lik a treat.

However, I don’t know how to read back the test results (which tests passed, which tests failed etc). I’m trying to read all of that back via pptr. It would make sense (to me, at least) that test.run() returns a promise for some sort of result data structure.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lukeedcommented, Aug 2, 2020

Hey Surma, sorry for the delay – recently I’ve been taking weekends away from the desk. Tomorrow morning I’ll publish my WIP browser layer on npm for you.

The TLDR is that suite.run used to do exactly that, but it made it near-impossible/super-unreliable to execute single-file tests (node test.js) since there’s no top-level await. You can call uvu.exec to process the queue youve built, but it writes results immediately.

Update tomorrow morning, hopefully

1reaction
hugomrdiascommented, Dec 8, 2020

Added support for uvu in playwright-test https://github.com/hugomrdias/playwright-test/releases/tag/v1.1.0 but I’m relying on the console.log output, having exec available and throwing on errors would make the integration more reliable and future proof.

Btw what’s the run entry point for? There’s a UVU_DEFER var there that could be used to manually stop the auto start for non cli runners.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Returning a Promise from "describe" is not supported. Tests ...
Particular test passed but I am getting this. describe('handlers. getSemesters', async () => { it('should return an array of Semesters', async  ...
Read more >
Testing-library: avoid these mistakes in async tests
Never forget to await for async functions or return promises from the test (jest will wait for this promise to be resolved in...
Read more >
Frequently Asked Questions - Jasmine Documentation
Why are some asynchronous spec failures reported as suite errors or as failures of a different spec? How can I stop Jasmine from...
Read more >
Promises - Node Tap
Additionally, if the function passed to t.test() returns a Promise, then the child test will be ended when the Promise resolves, or failed...
Read more >
Mocha - the fun, simple, flexible JavaScript test framework
Mocha is a feature-rich JavaScript test framework running on Node.js and in the ... In Mocha v3.0.0 and newer, returning a Promise and...
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