Skip to content

Commit 8c362f1

Browse files
committed
Use Node test runner
1 parent f68de5c commit 8c362f1

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
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
@@ -36,12 +36,11 @@
3636
"hast-util-is-element": "^2.0.0"
3737
},
3838
"devDependencies": {
39-
"@types/tape": "^4.0.0",
39+
"@types/node": "^18.0.0",
4040
"c8": "^7.0.0",
4141
"prettier": "^2.0.0",
4242
"remark-cli": "^11.0.0",
4343
"remark-preset-wooorm": "^9.0.0",
44-
"tape": "^5.0.0",
4544
"type-coverage": "^2.0.0",
4645
"typescript": "^4.0.0",
4746
"xo": "^0.53.0"

test.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
import test from 'tape'
1+
import assert from 'node:assert/strict'
2+
import test from 'node:test'
23
import {heading} from './index.js'
34

4-
test('heading', (t) => {
5-
t.equal(heading(), false, 'should return `false` without node')
5+
test('heading', () => {
6+
assert.equal(heading(), false, 'should return `false` without node')
67

7-
t.equal(heading(null), false, 'should return `false` with `null`')
8+
assert.equal(heading(null), false, 'should return `false` with `null`')
89

9-
t.equal(
10+
assert.equal(
1011
heading({type: 'text'}),
1112
false,
1213
'should return `false` when without `element`'
1314
)
1415

15-
t.equal(
16+
assert.equal(
1617
heading({type: 'element'}),
1718
false,
1819
'should return `false` when with invalid `element`'
1920
)
2021

21-
t.equal(
22+
assert.equal(
2223
heading({
2324
type: 'element',
2425
tagName: 'a',
@@ -29,7 +30,7 @@ test('heading', (t) => {
2930
'should return `false` when without not heading'
3031
)
3132

32-
t.equal(
33+
assert.equal(
3334
heading({
3435
type: 'element',
3536
tagName: 'h1',
@@ -38,6 +39,4 @@ test('heading', (t) => {
3839
true,
3940
'should return `true` when with heading'
4041
)
41-
42-
t.end()
4342
})

0 commit comments

Comments
 (0)