-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
38 lines (32 loc) · 831 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
38
import assert from 'node:assert/strict'
import test from 'node:test'
import {list, groups} from './index.js'
const own = {}.hasOwnProperty
test('list', function () {
assert.ok(Array.isArray(list), 'should be an `array`')
let index = -1
while (++index < list.length) {
assert.equal(
typeof list[index],
'string',
'`' + list[index] + '` should be string'
)
}
})
test('groups', function () {
assert.equal(typeof groups, 'object', 'should be an `object`')
/** @type {string} */
let label
for (label in groups) {
if (own.call(groups, label)) {
let index = -1
while (++index < groups[label].length) {
assert.equal(
typeof groups[label][index],
'string',
'`' + groups[label][index] + '` should be string'
)
}
}
}
})