-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
38 lines (32 loc) · 1.02 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
37
38
/* global describe, it */
const assert = require('chai').assert
const airportDiagrams = require('./index')
describe('airportDiagrams', () => {
it('should fetch airport diagrams for a single ICAO', () => {
return airportDiagrams('PANC').then(diagram => {
assert(diagram)
})
})
it('should fetch aiport diagrams for an array of ICAOs', () => {
return airportDiagrams(['PANC', 'KJAX']).then(diagrams => {
assert(diagrams.length === 2)
diagrams.map(assert)
})
})
it('should expose the list method', () => {
return airportDiagrams.list('PANC').then(diagram => {
assert(diagram)
})
})
it('should expose the fetchCurrentCycle method', () => {
return airportDiagrams.fetchCurrentCycle().then(cycle => {
assert(parseInt(cycle))
})
})
it('should fetch airport diagrams for an array of ICAOs using the list method', () => {
return airportDiagrams.list(['PANC', 'KJAX']).then(diagrams => {
assert(diagrams.length === 2)
diagrams.map(assert)
})
})
})