Subscribe on changes!

Unit test fail: packages/server-renderer/__tests__/webStream.spec.ts

avatar
Aug 18th 2021

Version

3.2.4

Reproduction link

https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8aDE+e3sgbXNnIH19PC9oMT5cbjwvdGVtcGxhdGU+XG5cbjxzY3JpcHQgc2V0dXA+XG5jb25zdCBtc2cgPSAnSGVsbG8gV29ybGQhJ1xuPC9zY3JpcHQ+In0=

Steps to reproduce

  1. Clone the source code
  2. Use yarn to install dependencies
  3. Run yarn test

What is expected?

All unit tests passed

What is actually happening?

Tests at packages/server-renderer/__tests__/webStream.spec.ts wrong.

Error message: Cannot find module 'stream/web' from 'packages/server-renderer/tests/webStream.spec.ts'


Node version: v14.17.4 Yarn version: v1.22.11

I have checked the tsconfig.json file, we do have dom lib, so I have no idea about how to address this issue.. This issue is related to source code, so the reproduction link is just a initial page.

Thank you for any help or advises!

avatar
Aug 18th 2021

Upgrade the node version to v16.7.0, The test cases can be passed.

For details, see: https://nodejs.org/dist/latest-v16.x/docs/api/webstreams.html#webstreams_web_streams_api

avatar
Aug 18th 2021

Upgrade the node version to v16.7.0, The test cases can be passed.

For details, see: https://nodejs.org/dist/latest-v16.x/docs/api/webstreams.html#webstreams_web_streams_api

It works, Really thank you! I forgot to check the doc of node, maybe we can add a code comment here? :thinking: