README
@serialport/binding-mock
import { MockBinding } from '@serialport/binding-mock'
const MockBinding = new MockBinding()
MockBinding.createPort('/dev/fakePort', { echo: true })
await MockBinding.write(Buffer.from('data')))
The mock serialport bindings
<script type="module">
import serialportBindingMock from 'https://cdn.skypack.dev/@serialport/binding-mock';
</script>
import { MockBinding } from '@serialport/binding-mock'
const MockBinding = new MockBinding()
MockBinding.createPort('/dev/fakePort', { echo: true })
await MockBinding.write(Buffer.from('data')))