Should `suite.run()` return a promise for the test results?
See original GitHub issueSo 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:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 calluvu.exec
to process the queue youve built, but it writes results immediately.Update tomorrow morning, hopefully
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.