uci-i2c-bus/test/bus.test.js

24 lines
493 B
JavaScript

'use strict'
const chai = require('chai'),
chaiAsPromised = require("chai-as-promised"),
Bus = require('../lib/bus').Bus,
Device = require('../lib/device').Device
chai.use(chaiAsPromised);
const expect = chai.expect
let bus = new Bus()
let addresses = [0x20, 0x23, 0x27]
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)
})
})