Skip to content

Introduce MockPortBinding.writeToPort to help with testing serialport-based code #2558

@Lucas-C

Description

@Lucas-C

💥 Proposal

What feature you'd like to see

Provide a way for MockPortBinding to write data to another MockPortBinding.

Motivation / Pitch

Often when testing a software application based on node-serialport,
we have several devices (2 a least) communicating through serial ports.
It can then be useful to mock the behaviour of the program on the other end of the serial port.
This is currently difficult to do with @serialport/binding-mock that only provides the ability to send data to itself and/or record it.

Pull Request

I submitted the following PR to provide this feature, including an example use case:
serialport/binding-mock#20

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions