Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure due to faulty data passed to Node.js streams #2076

Closed
BridgeAR opened this issue May 10, 2020 · 2 comments
Closed

Test failure due to faulty data passed to Node.js streams #2076

BridgeAR opened this issue May 10, 2020 · 2 comments

Comments

@BridgeAR
Copy link

Serialport is run in CITGM to verify that changes in Node.js do not break the module. Seems like serialport throws an error with the latest Node.js versions in one of the tests where faulty data is passed through to the streams API:

The error is:

1) listLinux
        rejects on non-zero exit codes:
      Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object
       at readableAddChunk (_stream_readable.js:252:13)
       at Readable.push (_stream_readable.js:220:10)
       at Object.spawn (packages/bindings/lib/mocks/linux-list.js:2:568)
       at /Users/iojs/tmp/citgm_tmp/dda96ec3-a570-4a8c-a7f3-a5aca58438c6/serialport/packages/bindings/lib/linux-list.js:2:1585
       at new Promise (<anonymous>)
       at listLinux (packages/bindings/lib/linux-list.js:2:1442)
       at Context.<anonymous> (packages/bindings/lib/linux-list.test.js:118:18)
       at processImmediate (internal/timers.js:456:21)

It is unclear to me what data should be written to the stream. Maybe just use JSON.stringify(mockPorts) to pass a string to stream.write()?

@reconbot
Copy link
Member

Fixed in #2079, it was the "null" value set on reset that it was complaining about.

@stale
Copy link

stale bot commented Jul 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.

@stale stale bot added the stale-issue label Jul 11, 2020
@stale stale bot closed this as completed Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants