Skip to content

Factor out portions of a test suite that can be run against already-constructed streams #264

@domenic

Description

@domenic

This is tricky, but important. The idea is that in the browser there will be various APIs that return an already-constructed stream. (E.g., fetch.) We would like to be able to test that these browser-constructed streams behave per spec. However, all of our current tests just create streams and then test them.

One way to do this would be to perhaps annotate the tests as having certain "prerequisite" streams passed in. For example:

  • Empty readable stream
  • Readable stream with 3 chunks
  • Errored readable stream
  • Readable stream with 1 chunk that becomes errored after 20 seconds

Then you could imagine that in the pure-JS test suite, we just manually create such streams, and then run the matching tests. But for the fetch tests, we use fetch + a local HTTP server with endpoints that respond in various ways to create the required stream.

Related a bit to #217.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions