Skip to content

Commit 88ea528

Browse files
committed
Use Node test runner
1 parent 70b15e6 commit 88ea528

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
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,13 +37,12 @@
3737
"nlcst-to-string": "^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",
4444
"remark-preset-wooorm": "^9.0.0",
4545
"retext": "^8.0.0",
46-
"tape": "^5.0.0",
4746
"type-coverage": "^2.0.0",
4847
"typescript": "^4.0.0",
4948
"unist-util-visit": "^4.0.0",

test.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
* @typedef {import('unist-util-visit/complex-types.js').Visitor<Word>} Visitor
99
*/
1010

11-
import assert from 'node:assert'
12-
import test from 'tape'
11+
import assert from 'node:assert/strict'
12+
import test from 'node:test'
1313
import {retext} from 'retext'
1414
import {visit} from 'unist-util-visit'
1515
import {isLiteral} from './index.js'
1616

17-
test('isLiteral()', (t) => {
18-
t.throws(
17+
test('isLiteral()', () => {
18+
assert.throws(
1919
() => {
2020
// @ts-expect-error runtime.
2121
isLiteral()
@@ -24,7 +24,7 @@ test('isLiteral()', (t) => {
2424
'should throw without arguments'
2525
)
2626

27-
t.throws(
27+
assert.throws(
2828
() => {
2929
// @ts-expect-error runtime.
3030
isLiteral({})
@@ -33,7 +33,7 @@ test('isLiteral()', (t) => {
3333
'should throw without parent'
3434
)
3535

36-
t.throws(
36+
assert.throws(
3737
() => {
3838
// @ts-expect-error runtime.
3939
isLiteral({children: []})
@@ -42,7 +42,7 @@ test('isLiteral()', (t) => {
4242
'should throw without node'
4343
)
4444

45-
t.throws(
45+
assert.throws(
4646
() => {
4747
// @ts-expect-error runtime.
4848
isLiteral({children: []}, {type: 'a'})
@@ -51,13 +51,13 @@ test('isLiteral()', (t) => {
5151
'should throw if `node` is not in `parent`'
5252
)
5353

54-
t.doesNotThrow(() => {
54+
assert.doesNotThrow(() => {
5555
const n = {type: 'a'}
5656
// @ts-expect-error runtime.
5757
isLiteral({children: [n]}, n)
5858
}, 'should not throw if `node` is in `parent`')
5959

60-
t.doesNotThrow(() => {
60+
assert.doesNotThrow(() => {
6161
process('Well? Ha! Funky', (_, index, parent_) => {
6262
const parent = /** @type {Parent} */ (parent_)
6363
assert.strictEqual(
@@ -67,7 +67,7 @@ test('isLiteral()', (t) => {
6767
})
6868
}, 'should work on single word sentences')
6969

70-
t.doesNotThrow(() => {
70+
assert.doesNotThrow(() => {
7171
const fixtures = [
7272
'Foo - is meant as a literal.',
7373
'Foo – is meant as a literal.',
@@ -93,7 +93,7 @@ test('isLiteral()', (t) => {
9393
}
9494
}, 'Initial')
9595

96-
t.doesNotThrow(() => {
96+
assert.doesNotThrow(() => {
9797
const fixtures = [
9898
'Meant as a literal is - foo.',
9999
'Meant as a literal is – foo.',
@@ -119,7 +119,7 @@ test('isLiteral()', (t) => {
119119
}
120120
}, 'Final')
121121

122-
t.doesNotThrow(() => {
122+
assert.doesNotThrow(() => {
123123
const fixtures = [
124124
'The word, foo, is meant as a literal.',
125125
'The word -foo- is meant as a literal.',
@@ -173,8 +173,6 @@ test('isLiteral()', (t) => {
173173
})
174174
}
175175
}, 'Internal')
176-
177-
t.end()
178176
})
179177

180178
/**

0 commit comments

Comments
 (0)