There's helpers in assertion libraries for that. Also, mocha supports getting a promise out so you can write a chain in your test. If you dont like the boilerplate, await keyword helps reduce most of it. Where's the horror? ;)
-
-
-
I find promises and stream intertwined isn't straight-forward to reason about, especially when you test this out. From the testing perspective - there's no built-in stream related mocks so I had to extend EventEmitter and mock it myself. It's ugly :-)
- Još 4 druga odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.
Developer Advocate 