-
Notifications
You must be signed in to change notification settings - Fork 20
/
test.js
37 lines (30 loc) · 836 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
37
const test = require('node:test');
const assert = require('assert');
const deprecated = require('./deprecated');
const valid = require('.');
test('require(\'spdx-license-ids\')', t => {
assert(Array.isArray(valid), 'should be an array.');
assert(
valid.includes('LGPL-3.0-or-later'),
'should include non-deprecated license IDs.'
);
assert(
!valid.includes('Nunit'),
'should not include deprecated license IDs.'
);
});
test('require(\'spdx-license-ids/deprecated\')', t => {
assert(Array.isArray(deprecated), 'should be an array.');
assert(
deprecated.length < valid.length,
'should be smaller than the main export.'
);
assert(
deprecated.includes('eCos-2.0'),
'should include deprecated license IDs.'
);
assert(
!deprecated.includes('ISC'),
'should not include non-deprecated license IDs.'
);
});