Comments (6)
For late assertion collection, you should have an error
import {test} from 'zora';
test('woot', ({ok}) => {
// setTimeout is not awaited
setTimeout(() => {
ok(false)
});
ok(true);
})
Hence, I am not sure what you are referring to. Would you mind providing a short repro ?
from zora.
Its the opposire of late assertion. Create a test that returns new Promise(() => {}).then(() => t.equal(0, 1))
from zora.
Oh I see. Thanks. I'am getting a look at it
from zora.
Apparently, finding a broken promise is quite a thing
The only easy way I can think of (which would be cross platform) is to make the user spec function compete with a timeout function and throw if the timeout wins.
something like this PR
from zora.
Here's what I'd do:
- When you register tests add them to a map
- When they conclude, remove them from the map
- On
'exit'
hook, print the ones that are not concluded - Profit
You don't actually need to know what the state of the promise is, you can solve it reliably on the framework level.
from zora.
Actually that's not that simple. There is only an exit hook in a nodejs environment (and Deno) but not in the browser. You can't either add this check after the reporting stream as it is simply broken (the code after won't run).
I think I'll rather go for test timeout which adds anyway a nice to have assertion
from zora.
Related Issues (20)
- Difference to Tape / AVA? HOT 1
- Add examples for Svelte, Vue and React HOT 1
- Structured comparison HOT 6
- Switching between character/line diff? HOT 1
- Assert type problems: can't extend assertion types in TypeScript
- Improve diff reporter HOT 6
- Bad type-declaration for `throws` HOT 1
- Pipe error handling (write EPIPE) HOT 2
- Inconsistent behaviour of tap reporters HOT 2
- Empty test.ts file in the node-ts example HOT 1
- build npm package HOT 3
- Zora + pta doesn't work with top level dynamic imports HOT 5
- Question: flow control across multiple files HOT 9
- Discussion: enable mix of cjs and es test code. HOT 5
- Example of cleaner ts-node setup with pta + TypeScript
- Zora doesn't recognize differences bewteen Maps HOT 2
- The new timeout feature doesn't work correctly for serial tests (await) HOT 1
- pta reports PASS 0 before passing Zora tests finish running HOT 6
- How to know when all tests have completed? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zora.