-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathtest.js
36 lines (30 loc) · 1.21 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const test = require('ava');
const devices = require( './index' );
test( 'deviceList()', t => {
t.is( typeof devices.deviceList, 'function' );
t.truthy( Array.isArray( devices.deviceList() ) );
} );
test( 'brandList()', t => {
t.is( typeof devices.brandList, 'function' );
t.truthy( Array.isArray( devices.brandList() ) );
} );
test( 'getDevicesByBrand()', t => {
t.is( typeof devices.getDevicesByBrand, 'function' );
t.throws( function () { devices.getDevicesByBrand(); } );
t.truthy( Array.isArray( devices.getDevicesByBrand( '' ) ) );
} );
test( 'getDevicesByName()', t => {
t.is( typeof devices.getDevicesByName, 'function' );
t.throws( function () { devices.getDevicesByName(); } );
t.truthy( Array.isArray( devices.getDevicesByName( '' ) ) );
} );
test( 'getDevicesByDeviceId()', t => {
t.is( typeof devices.getDevicesByDeviceId, 'function' );
t.throws( function () { devices.getDevicesByDeviceId(); } );
t.truthy( Array.isArray( devices.getDevicesByDeviceId( '' ) ) );
} );
test( 'getDevicesByModel()', t => {
t.is( typeof devices.getDevicesByModel, 'function' );
t.throws( function () { devices.getDevicesByModel(); } );
t.truthy( Array.isArray( devices.getDevicesByModel( '' ) ) );
} );