forked from DenisCarriere/mbtiles-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
31 lines (27 loc) · 700 Bytes
/
test.js
File metadata and controls
31 lines (27 loc) · 700 Bytes
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
const path = require('path')
const { test } = require('tap')
const { getFiles } = require('./utils')
const server = require('./')
const cache = path.join(__dirname, 'test', 'fixtures')
test('utils', t => {
const files = getFiles(cache)
t.deepEqual(files, ['canada_zoom_0-3', 'fiji_zoom_0-4', 'world_zoom_0-2'])
t.end()
})
test('server -- start & close', t => {
const ee = server({ port: 3000, cache })
ee.on('start', async () => {
t.pass()
await ee.close()
t.end()
})
})
test('server -- restart', t => {
const ee = server({ port: 3001, cache })
setTimeout(async () => {
await ee.restart({ port: 3002, cache })
t.pass()
await ee.close()
t.end()
})
})