2017-01-15 17:59:50 -08:00
|
|
|
'use strict'
|
|
|
|
|
2017-01-15 23:16:14 -08:00
|
|
|
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
|
2017-01-15 17:59:50 -08:00
|
|
|
|
|
|
|
let bus = new Bus()
|
|
|
|
|
2017-01-15 23:16:14 -08:00
|
|
|
let addresses = [0x20, 0x23, 0x27]
|
2017-01-15 17:59:50 -08:00
|
|
|
|
|
|
|
describe('Bus Class - ', function () {
|
|
|
|
|
2017-01-15 23:16:14 -08:00
|
|
|
it('Can scan the bus for devices', function () {
|
2017-01-15 17:59:50 -08:00
|
|
|
|
2017-01-15 23:16:14 -08:00
|
|
|
return expect(bus.scan().catch(err => console.log("an error", err))).to.eventually.deep.equal(addresses)
|
|
|
|
|
|
|
|
})
|
2017-01-15 18:47:43 -08:00
|
|
|
})
|