Skip to content

Commit f7eec7b

Browse files
committed
Use Node test runner
1 parent efff043 commit f7eec7b

File tree

7 files changed

+658
-792
lines changed

7 files changed

+658
-792
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
name: ${{matrix.node}}
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: dcodeIO/setup-node-nvm@master
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
1212
with:
1313
node-version: ${{matrix.node}}
1414
- run: npm install
1515
- run: npm test
16-
- uses: codecov/codecov-action@v1
16+
- uses: codecov/codecov-action@v3
1717
strategy:
1818
matrix:
1919
node:
20-
- lts/fermium
20+
- lts/hydrogen
2121
- node

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@
5656
"zwitch": "^2.0.0"
5757
},
5858
"devDependencies": {
59-
"@types/tape": "^4.0.0",
59+
"@types/node": "^18.0.0",
6060
"c8": "^7.0.0",
6161
"hastscript": "^7.0.0",
6262
"prettier": "^2.0.0",
6363
"remark-cli": "^11.0.0",
6464
"remark-preset-wooorm": "^9.0.0",
65-
"tape": "^5.0.0",
6665
"type-coverage": "^2.0.0",
6766
"typescript": "^4.0.0",
6867
"unist-builder": "^3.0.0",
@@ -88,7 +87,17 @@
8887
"prettier": true,
8988
"rules": {
9089
"max-params": "off"
91-
}
90+
},
91+
"overrides": [
92+
{
93+
"files": [
94+
"test/**/*.js"
95+
],
96+
"rules": {
97+
"no-await-in-loop": 0
98+
}
99+
}
100+
]
92101
},
93102
"remarkConfig": {
94103
"plugins": [

test/all.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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 {selectAll} from '../index.js'
56

6-
test('all together now', (t) => {
7-
t.deepEqual(
7+
test('all together now', () => {
8+
assert.deepEqual(
89
selectAll(
910
'dl > dt.foo:nth-of-type(odd)',
1011
u('root', [
@@ -28,7 +29,7 @@ test('all together now', (t) => {
2829
[h('dt.foo', 'Alpha')]
2930
)
3031

31-
t.deepEqual(
32+
assert.deepEqual(
3233
selectAll(
3334
'.foo ~ dd:nth-of-type(even)',
3435
u('root', [
@@ -56,7 +57,7 @@ test('all together now', (t) => {
5657
[h('dd', 'Delta'), h('dd', 'Hotel')]
5758
)
5859

59-
t.deepEqual(
60+
assert.deepEqual(
6061
selectAll(
6162
'.foo + dd:nth-of-type(even)',
6263
u('root', [
@@ -84,7 +85,7 @@ test('all together now', (t) => {
8485
[h('dd', 'Delta')]
8586
)
8687

87-
t.deepEqual(
88+
assert.deepEqual(
8889
selectAll(
8990
'.foo, :nth-of-type(even), [title]',
9091
u('root', [
@@ -109,6 +110,4 @@ test('all together now', (t) => {
109110
h('dt', {title: 'bar'}, 'Alpha')
110111
]
111112
)
112-
113-
t.end()
114113
})

0 commit comments

Comments
 (0)