-
Notifications
You must be signed in to change notification settings - Fork 9
/
test.js
36 lines (29 loc) · 956 Bytes
/
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
/* global describe, it */
const assert = require('assert')
const notams = require('./index')
describe('notams', () => {
it('should fetch NOTAMs for a single ICAO', async () => {
const res = await notams('KFDC')
assert(res.length === 1)
})
it('should fetch NOTAMs for a comma separated list of ICAOs', async () => {
const res = await notams([ 'KFDC,KZBW' ])
assert(res.length === 2)
})
it('should fetch NOTAMs for an array of ICAOs', async () => {
const res = await notams([ 'KFDC', 'KZBW' ])
assert(res.length === 2)
})
it('should expose the fetch method', async () => {
const res = await notams.fetch('KFDC')
assert(res.length === 1)
})
it('should fetch NOTAMs by type', async () => {
const res = await notams.fetchAllByType('ALLTFR')
assert(res.length > 0)
})
it('should fetch all NOTAMs', async () => {
const res = await notams.fetchAll('KFDC')
assert(res.length > 2)
})
})