-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.js
33 lines (25 loc) · 952 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
const assert = require('assert');
const ifct2017 = require('./');
async function testAll() {
await ifct2017.compositions.load();
var a = ifct2017.compositions('pineapple');
var b = ifct2017.compositions('ananas comosus');
assert.deepStrictEqual(a[0].code, 'E053');
assert.deepStrictEqual(b[0].code, 'E053');
var a = ifct2017.columns('vitamin c');
var b = ifct2017.columns('c-vitamin');
assert.deepStrictEqual(a[0].code, 'vitc');
assert.deepStrictEqual(b[0].code, 'vitc');
var a = ifct2017.pictures.unpkg('A001');
var b = 'https://unpkg.com/@ifct2017/pictures/assets/A001.jpeg';
assert.deepStrictEqual(a, b);
var a = ifct2017.intakes('his');
var b = ifct2017.intakes('Histidine');
var c = [{
code: 'his', whorda: -0.01, usear: NaN, usrdam: -0.014, usrdaf: NaN,
euprim: NaN, euprif: NaN, ulus: NaN, uleu: NaN, uljapan: NaN
}];
assert.deepStrictEqual(a, c);
assert.deepStrictEqual(b, c);
}
testAll();