Skip to content

Commit a0b6fd6

Browse files
committedNov 20, 2022
Use Node test runner
1 parent 78c1f7c commit a0b6fd6

File tree

3 files changed

+22
-34
lines changed

3 files changed

+22
-34
lines changed
 

‎.github/workflows/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
name: ${{matrix.node}}
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: dcodeIO/setup-node-nvm@master
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
1212
with:
1313
node-version: ${{matrix.node}}
1414
- run: npm install
1515
- run: npm test
16-
- uses: codecov/codecov-action@v1
16+
- uses: codecov/codecov-action@v3
1717
strategy:
1818
matrix:
1919
node:
20-
- lts/erbium
20+
- lts/hydrogen
2121
- node

‎package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"index.js"
3434
],
3535
"devDependencies": {
36-
"@types/tape": "^4.0.0",
36+
"@types/node": "^18.0.0",
3737
"c8": "^7.0.0",
3838
"concat-stream": "^2.0.0",
3939
"hast-util-select": "^5.0.0",
@@ -42,7 +42,6 @@
4242
"rehype-parse": "^8.0.0",
4343
"remark-cli": "^11.0.0",
4444
"remark-preset-wooorm": "^9.0.0",
45-
"tape": "^5.0.0",
4645
"type-coverage": "^2.0.0",
4746
"typescript": "^4.0.0",
4847
"unified": "^10.0.0",

‎test.js

+17-28
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
1-
import test from 'tape'
1+
import assert from 'node:assert/strict'
2+
import test from 'node:test'
23
import {unM49} from './index.js'
34

4-
test('m49', function (t) {
5-
t.plan(3)
5+
test('m49', function () {
6+
assert.ok(Array.isArray(unM49), 'should be an `array`')
67

7-
t.ok(Array.isArray(unM49), 'should be an `array`')
8-
9-
let index = -1
10-
let found = false
11-
12-
while (++index < unM49.length) {
13-
if (unM49[index].code !== '826') {
14-
continue
15-
}
16-
17-
found = true
18-
t.deepEqual(
19-
unM49[index],
20-
{
21-
type: 4,
22-
name: 'United Kingdom of Great Britain and Northern Ireland',
23-
code: '826',
24-
iso3166: 'GBR',
25-
parent: '154'
26-
},
27-
'should work'
28-
)
29-
}
30-
31-
t.equal(found, true, 'expected `826` in array')
8+
const gbr = unM49.find((d) => d.code === '826')
9+
assert(gbr)
10+
assert.deepEqual(
11+
gbr,
12+
{
13+
type: 4,
14+
name: 'United Kingdom of Great Britain and Northern Ireland',
15+
code: '826',
16+
iso3166: 'GBR',
17+
parent: '154'
18+
},
19+
'should work'
20+
)
3221
})

0 commit comments

Comments
 (0)
Please sign in to comment.