-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.test.js
59 lines (47 loc) · 1.19 KB
/
index.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const test = require('tape');
const path = require('path');
const { getProfileNames, extract, contract, datastore } = require('./');
const extractPath = path.join(__dirname, 'data', 'monaco.osm.pbf');
const profileName = 'car';
test('getProfileNames', async t => {
try {
const profileNames = await getProfileNames();
t.ok(profileNames.length > 0);
} catch (error) {
t.fail(error.message);
}
t.end();
});
test('extract', async t => {
try {
const graphPath = await extract(extractPath, profileName);
t.ok(graphPath);
} catch (error) {
t.fail(error.message);
}
t.end();
});
test('contract', async t => {
try {
const graphPath = await extract(extractPath, profileName);
t.ok(graphPath);
const graphPath2 = await contract(graphPath);
t.ok(graphPath2);
} catch (error) {
t.fail(error.message);
}
t.end();
});
test('datastore', async t => {
try {
const graphPath = await extract(extractPath, profileName);
t.ok(graphPath);
const graphPath2 = await contract(graphPath);
t.ok(graphPath2);
const graphPath3 = await datastore(graphPath);
t.ok(graphPath3);
} catch (error) {
t.fail(error.message);
}
t.end();
});