Skip to content

Commit de13ee2

Browse files
committed
Use Node test runner
1 parent 1d8f30b commit de13ee2

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
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
@@ -36,12 +36,11 @@
3636
"@types/xast": "^1.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
"unist-builder": "^3.0.0",

test.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
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('xast-util-to-string', (t) => {
6-
t.deepEqual(
6+
test('xast-util-to-string', () => {
7+
assert.deepEqual(
78
toString(u('cdata', '<greeting>Hello, world!</greeting>')),
89
'<greeting>Hello, world!</greeting>',
910
'should serialize cdata'
1011
)
1112

12-
t.deepEqual(toString(u('comment', 'foo')), 'foo', 'should serialize comments')
13+
assert.deepEqual(
14+
toString(u('comment', 'foo')),
15+
'foo',
16+
'should serialize comments'
17+
)
1318

14-
t.deepEqual(
19+
assert.deepEqual(
1520
toString(u('instruction', {name: 'xml'}, 'version="1.0" encoding="UTF-8"')),
1621
'version="1.0" encoding="UTF-8"',
1722
'should serialize instructions'
1823
)
1924

20-
t.deepEqual(toString(u('text', 'foo')), 'foo', 'should serialize texts')
25+
assert.deepEqual(toString(u('text', 'foo')), 'foo', 'should serialize texts')
2126

22-
t.deepEqual(
27+
assert.deepEqual(
2328
toString(u('doctype', {name: 'html'})),
2429
'',
2530
'should return empty for doctypes'
2631
)
2732

28-
t.deepEqual(
33+
assert.deepEqual(
2934
toString(
3035
u('element', {name: 'package'}, [
3136
u('text', 'foo '),
@@ -37,7 +42,7 @@ test('xast-util-to-string', (t) => {
3742
'should serialize elements (excluding non-parent and non-text descendants)'
3843
)
3944

40-
t.deepEqual(
45+
assert.deepEqual(
4146
toString(
4247
u('root', [
4348
u('doctype', {name: 'html'}),
@@ -49,6 +54,4 @@ test('xast-util-to-string', (t) => {
4954
'foo baz',
5055
'should serialize roots (excluding non-parent and non-text descendants)'
5156
)
52-
53-
t.end()
5457
})

0 commit comments

Comments
 (0)