Skip to content

Commit 65f0c8b

Browse files
committed
Use Node test runner
1 parent fdedbd0 commit 65f0c8b

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
strategy:
1818
matrix:
1919
node:
20-
- lts/fermium
20+
- lts/hydrogen
2121
- node

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@
3737
"@types/hast": "^2.0.0"
3838
},
3939
"devDependencies": {
40-
"@types/tape": "^4.0.0",
40+
"@types/node": "^18.0.0",
4141
"c8": "^7.0.0",
4242
"hastscript": "^7.0.0",
4343
"prettier": "^2.0.0",
4444
"remark-cli": "^11.0.0",
4545
"remark-preset-wooorm": "^9.0.0",
4646
"rimraf": "^3.0.0",
47-
"tape": "^5.0.0",
4847
"type-coverage": "^2.0.0",
4948
"typescript": "^4.0.0",
5049
"xo": "^0.53.0"

test.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
import test from 'tape'
1+
import assert from 'node:assert/strict'
2+
import test from 'node:test'
23
import {h} from 'hastscript'
34
import {headingRank} from './index.js'
45

5-
test('headingRank', (t) => {
6+
test('headingRank', () => {
67
// @ts-expect-error runtime.
7-
t.equal(headingRank(), null, 'should return null for non-nodes')
8+
assert.equal(headingRank(), null, 'should return null for non-nodes')
89

9-
t.equal(
10+
assert.equal(
1011
headingRank({type: 'text', value: '!'}),
1112
null,
1213
'should return null for non-elements'
1314
)
1415

15-
t.equal(headingRank(h('p', '!')), null, 'should return null for non-headings')
16-
17-
t.equal(headingRank(h('h5', '!')), 5, 'should return the rank of a heading')
16+
assert.equal(
17+
headingRank(h('p', '!')),
18+
null,
19+
'should return null for non-headings'
20+
)
1821

19-
t.end()
22+
assert.equal(
23+
headingRank(h('h5', '!')),
24+
5,
25+
'should return the rank of a heading'
26+
)
2027
})

0 commit comments

Comments
 (0)