1
1
import { assert , shouldReject } from '../test/assert'
2
2
import { makeTestFeature } from '../test/makeTestFeature'
3
3
import { BindingInterface , OpenOptions , PortInfo , SetOptions } from './binding-interface'
4
- import Binding , { AllBindingClasses } from './index'
4
+ import { autoDetect , AllBindingClasses } from './index'
5
5
import MockBinding from '@serialport/binding-mock'
6
6
7
7
const defaultOpenOptions : OpenOptions = Object . freeze ( {
@@ -37,7 +37,7 @@ const listFields = ['path', 'manufacturer', 'serialNumber', 'pnpId', 'locationId
37
37
const readyData = Buffer . from ( 'READY' )
38
38
39
39
testBinding ( 'mock' , MockBinding , '/dev/exists' )
40
- testBinding ( process . platform , Binding , process . env . TEST_PORT )
40
+ testBinding ( process . platform , autoDetect ( ) , process . env . TEST_PORT )
41
41
42
42
function testBinding ( bindingName : string , Binding : AllBindingClasses , testPort ?: string ) {
43
43
const { testFeature, testHardware, describeHardware } = makeTestFeature ( bindingName , testPort )
@@ -52,7 +52,6 @@ function testBinding(bindingName: string, Binding: AllBindingClasses, testPort?:
52
52
describe ( 'static method' , ( ) => {
53
53
describe ( '.list' , ( ) => {
54
54
it ( 'returns an array' , async ( ) => {
55
- console . log ( { Binding } )
56
55
const ports = await Binding . list ( )
57
56
assert . isArray ( ports )
58
57
} )
0 commit comments