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

24 lines
493 B
JavaScript
Raw Normal View History

'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)
})
2017-01-15 18:47:43 -08:00
})