Skip to content

Commit 6016864

Browse files
committed
Use Node test runner
1 parent af500a9 commit 6016864

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
"hast-util-truncate": "^1.0.0"
3939
},
4040
"devDependencies": {
41-
"@types/acorn": "^4.0.6",
42-
"@types/tape": "^4.0.0",
41+
"@types/node": "^18.0.0",
4342
"c8": "^7.0.0",
4443
"hast-util-select": "^5.0.0",
4544
"hastscript": "^7.0.0",
@@ -50,7 +49,6 @@
5049
"prettier": "^2.0.0",
5150
"remark-cli": "^11.0.0",
5251
"remark-preset-wooorm": "^9.0.0",
53-
"tape": "^5.0.0",
5452
"type-coverage": "^2.0.0",
5553
"typescript": "^4.0.0",
5654
"unist-builder": "^3.0.0",

test.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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 {h} from 'hastscript'
45
import {removePosition} from 'unist-util-remove-position'
@@ -9,8 +10,8 @@ import {mdxFromMarkdown} from 'mdast-util-mdx'
910
import {toHast} from 'mdast-util-to-hast'
1011
import {excerpt} from './index.js'
1112

12-
test('hastUtilExcerpt', (t) => {
13-
t.deepEqual(
13+
test('excerpt', () => {
14+
assert.deepEqual(
1415
excerpt(
1516
h('div', [
1617
h('p', 'Lorem ipsum dolor sit amet.'),
@@ -22,7 +23,7 @@ test('hastUtilExcerpt', (t) => {
2223
'should copy to an excerpt comment'
2324
)
2425

25-
t.deepEqual(
26+
assert.deepEqual(
2627
excerpt(
2728
h('div', [
2829
h('p', 'Lorem ipsum dolor sit amet.'),
@@ -35,7 +36,7 @@ test('hastUtilExcerpt', (t) => {
3536
'should support `maxSearchSize`'
3637
)
3738

38-
t.deepEqual(
39+
assert.deepEqual(
3940
excerpt(
4041
h('div', [
4142
h('p', [
@@ -49,7 +50,7 @@ test('hastUtilExcerpt', (t) => {
4950
'should copy to an excerpt comment inside a paragraph'
5051
)
5152

52-
t.deepEqual(
53+
assert.deepEqual(
5354
excerpt(
5455
h('div', [
5556
h('p', 'Lorem ipsum dolor sit amet.'),
@@ -60,7 +61,7 @@ test('hastUtilExcerpt', (t) => {
6061
'should return `undefined` if there’s no comment'
6162
)
6263

63-
t.deepEqual(
64+
assert.deepEqual(
6465
excerpt(
6566
h('div', [
6667
h('p', 'Lorem ipsum dolor sit amet.'),
@@ -72,7 +73,7 @@ test('hastUtilExcerpt', (t) => {
7273
'should not match on comments with other values'
7374
)
7475

75-
t.deepEqual(
76+
assert.deepEqual(
7677
excerpt(
7778
h('div', [
7879
h('p', 'Lorem ipsum dolor sit amet.'),
@@ -91,13 +92,13 @@ test('hastUtilExcerpt', (t) => {
9192
h('p', 'Consectetur adipisicing elit.')
9293
])
9394

94-
t.deepEqual(
95+
assert.deepEqual(
9596
excerpt(tree, {ignore: selectAll('del', tree)}),
9697
h('div', [h('p', ['Lorem ipsum ', ' sit amet.'])]),
9798
'should support `ignore`'
9899
)
99100

100-
t.deepEqual(
101+
assert.deepEqual(
101102
excerpt(
102103
// @ts-expect-error: hush!
103104
toHast(
@@ -113,6 +114,4 @@ test('hastUtilExcerpt', (t) => {
113114
u('root', [h('p', 'Some text'), u('text', '\n')]),
114115
'should integrate w/ `mdast-util-mdx` (support `/* comments */`)'
115116
)
116-
117-
t.end()
118117
})

0 commit comments

Comments
 (0)