HydreIO/doubt

Doubt doesn't print anything

Sceat opened this issue · 0 comments

Sceat commented

I found a case where the lib run without printing anything nor exiting with an error 🤔
My case was due to a stream never ending inside a suite or something related to pipelines

When you promisify a pipeline and run an endless stream while running doubt top-level then the event loop just exit without allowing doubt to run till the end thus processing tests completion

await pipeline(
	endless_readable,
    async source => {
      for await (const chunk of source) {
        affirm({
          that   : 'foo',
          should : 'bar',
          because: !!chunk,
          is     : true,
        })
        // source.end()
      }
    }
)

If we ommit source.end() above then it may break