Skip to content

Commit 18dca94

Browse files
committed
Use Node test runner
1 parent f717b75 commit 18dca94

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
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/gallium
2121
- node

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@
3737
"@types/nlcst": "^1.0.0"
3838
},
3939
"devDependencies": {
40-
"@types/tape": "^4.0.0",
40+
"@types/node": "^18.0.0",
4141
"c8": "^7.0.0",
4242
"prettier": "^2.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
"unist-builder": "^3.0.0",

test.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import test from 'tape'
1+
import assert from 'node:assert/strict'
2+
import test from 'node:test'
23
import {u} from 'unist-builder'
34
import {toString} from './index.js'
45

5-
test('toString()', (t) => {
6-
t.throws(
6+
test('toString()', () => {
7+
assert.throws(
78
() => {
89
// @ts-expect-error: runtime.
910
toString()
@@ -12,7 +13,7 @@ test('toString()', (t) => {
1213
'should throw when not given a node (#1)'
1314
)
1415

15-
t.throws(
16+
assert.throws(
1617
() => {
1718
// @ts-expect-error: missing `type`.
1819
toString({value: 'foo'})
@@ -21,9 +22,9 @@ test('toString()', (t) => {
2122
'should throw when not given a node (#2)'
2223
)
2324

24-
t.equal(toString(u('TextNode', 'AT')), 'AT', 'should support texts')
25+
assert.equal(toString(u('TextNode', 'AT')), 'AT', 'should support texts')
2526

26-
t.equal(
27+
assert.equal(
2728
toString(
2829
u('WordNode', [
2930
u('TextNode', 'AT'),
@@ -35,13 +36,13 @@ test('toString()', (t) => {
3536
'should support parents'
3637
)
3738

38-
t.equal(
39+
assert.equal(
3940
toString([u('TextNode', 'AT'), u('SymbolNode', '&'), u('TextNode', 'T')]),
4041
'AT&T',
4142
'should support nodes'
4243
)
4344

44-
t.equal(
45+
assert.equal(
4546
toString(
4647
// @ts-expect-error: custom.
4748
u('WordNode', [
@@ -54,7 +55,7 @@ test('toString()', (t) => {
5455
'should support parents with mixed children'
5556
)
5657

57-
t.equal(
58+
assert.equal(
5859
toString(
5960
// @ts-expect-error: custom.
6061
u('WordNode', [
@@ -69,7 +70,5 @@ test('toString()', (t) => {
6970
)
7071

7172
// @ts-expect-error: custom node.
72-
t.equal(toString(u('VoidNode')), '', 'should support voids')
73-
74-
t.end()
73+
assert.equal(toString(u('VoidNode')), '', 'should support voids')
7574
})

0 commit comments

Comments
 (0)