We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3528b9d commit 7160182Copy full SHA for 7160182
packages/stream/lib/index.test.ts
@@ -791,6 +791,26 @@ describe('SerialPort', () => {
791
})
792
793
794
+
795
+ describe('#destroy', () => {
796
+ it('calls close', done => {
797
+ const port = new SerialPortStream(openOpts)
798
+ port.on('close', () => done())
799
+ port.destroy()
800
+ })
801
802
+ it("doesn't open after destroy", done => {
803
804
+ port.on('open', () => {
805
806
+ assert.isTrue(port.destroyed)
807
+ port.open(err => {
808
+ assert.instanceOf(err, Error)
809
+ done()
810
811
812
813
814
815
816
describe('reading data', () => {
0 commit comments