uci-i2c-bus/test/bus.test.mjs

22 lines
449 B
JavaScript

import Bus from '../src/bus'
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
chai.use(chaiAsPromised)
const expect = chai.expect
let bus = new Bus()
const addresses = [0x25, 0x26, 0x27]
// const addresses = []
describe('Bus Class - ', function () {
it('Can scan the bus for devices', function () {
return expect(bus.scan().catch(err => console.log('an error', err))).to.eventually.deep.equal(addresses)
})
})