Skip to content

Commit ab7eb0b

Browse files
committed
Use Node test runner
1 parent eede172 commit ab7eb0b

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

.github/workflows/main.yml

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@types/mdast": "^3.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",

test.js

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

4-
test('toString', (t) => {
5+
test('toString', () => {
56
// @ts-expect-error: runtime.
6-
t.equal(toString(), '', 'should not fail on a missing node')
7-
t.equal(toString(null), '', 'should not fail on `null` missing node')
7+
assert.equal(toString(), '', 'should not fail on a missing node')
8+
assert.equal(toString(null), '', 'should not fail on `null` missing node')
89

9-
t.equal(toString({value: 'foo'}), 'foo', 'should not fail on nodes w/o type')
10+
assert.equal(
11+
toString({value: 'foo'}),
12+
'foo',
13+
'should not fail on nodes w/o type'
14+
)
1015

11-
t.equal(
16+
assert.equal(
1217
toString({
1318
value: 'foo',
1419
alt: 'bar',
@@ -19,37 +24,35 @@ test('toString', (t) => {
1924
'should prefer `value` over all others'
2025
)
2126

22-
t.equal(
27+
assert.equal(
2328
toString({alt: 'bar', title: 'baz', children: [{value: 'qux'}]}),
2429
'bar',
2530
'should prefer `alt` over all others'
2631
)
2732

28-
t.equal(
33+
assert.equal(
2934
toString({title: 'baz', children: [{value: 'qux'}]}),
3035
'qux',
3136
'should *not* prefer `title` over all others'
3237
)
3338

34-
t.equal(
39+
assert.equal(
3540
toString({alt: 'bar'}, {includeImageAlt: false}),
3641
'',
3742
'should *not* include `alt` w/ `includeImageAlt: false`'
3843
)
3944

40-
t.equal(
45+
assert.equal(
4146
toString({children: [{value: 'foo'}, {alt: 'bar'}, {title: 'baz'}]}),
4247
'foobar',
4348
'should serialize children'
4449
)
4550

46-
t.equal(
51+
assert.equal(
4752
toString([{value: 'foo'}, {alt: 'bar'}, {title: 'baz'}]),
4853
'foobar',
4954
'should serialize a list of nodes'
5055
)
5156

52-
t.equal(toString({}), '', 'should produce an empty string otherwise')
53-
54-
t.end()
57+
assert.equal(toString({}), '', 'should produce an empty string otherwise')
5558
})

0 commit comments

Comments
 (0)