mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-29 10:08:51 +00:00
34 lines
706 B
CoffeeScript
34 lines
706 B
CoffeeScript
expect = require('chai').expect
|
|
device = require('./device')
|
|
|
|
describe 'Device:', ->
|
|
|
|
describe '#getDisplayName()', ->
|
|
|
|
it 'should return Raspberry Pi for that device', ->
|
|
possibleNames = [
|
|
'raspberry-pi'
|
|
'raspberrypi'
|
|
'rpi'
|
|
]
|
|
|
|
for name in possibleNames
|
|
expect(device.getDisplayName(name)).to.equal('Raspberry Pi')
|
|
|
|
it 'should return unknown if no matches', ->
|
|
unknownNames = [
|
|
'hello'
|
|
'foobar'
|
|
{}
|
|
123
|
|
]
|
|
|
|
for name in unknownNames
|
|
expect(device.getDisplayName(name)).to.equal('Unknown')
|
|
|
|
describe '#getSupportedDevices()', ->
|
|
|
|
it 'should return an array', ->
|
|
result = device.getSupportedDevices()
|
|
expect(result).to.be.an.instanceof(Array)
|