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"),
|
2017-01-16 22:44:10 -08:00
|
|
|
Bus = require('../lib/bus').Bus
|
2017-01-15 23:16:14 -08:00
|
|
|
|
2017-01-16 22:44:10 -08:00
|
|
|
chai.use(chaiAsPromised)
|
2017-01-15 23:16:14 -08:00
|
|
|
|
|
|
|
const expect = chai.expect
|
2017-01-15 17:59:50 -08:00
|
|
|
|
|
|
|
let bus = new Bus()
|
|
|
|
|
2017-01-16 22:44:10 -08:00
|
|
|
// const addresses = [0x20, 0x26, 0x27]
|
|
|
|
const addresses = []
|
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
|
|
|
})
|