Skip to content

Commit 94482b3

Browse files
committed
Use Node test runner
1 parent acd6553 commit 94482b3

File tree

6 files changed

+399
-514
lines changed

6 files changed

+399
-514
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
@@ -55,12 +55,11 @@
5555
"zwitch": "^2.0.0"
5656
},
5757
"devDependencies": {
58-
"@types/tape": "^4.0.0",
58+
"@types/node": "^18.0.0",
5959
"c8": "^7.0.0",
6060
"prettier": "^2.0.0",
6161
"remark-cli": "^11.0.0",
6262
"remark-preset-wooorm": "^9.0.0",
63-
"tape": "^5.0.0",
6463
"type-coverage": "^2.0.0",
6564
"typescript": "^4.0.0",
6665
"unist-builder": "^3.0.0",
@@ -86,7 +85,17 @@
8685
"prettier": true,
8786
"rules": {
8887
"max-params": "off"
89-
}
88+
},
89+
"overrides": [
90+
{
91+
"files": [
92+
"test/**/*.js"
93+
],
94+
"rules": {
95+
"no-await-in-loop": 0
96+
}
97+
}
98+
]
9099
},
91100
"remarkConfig": {
92101
"plugins": [

test/all.js

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

5-
test('all together now', (t) => {
6-
t.deepEqual(
6+
test('all together now', () => {
7+
assert.deepEqual(
78
selectAll(
89
'a > b[d]:nth-of-type(odd)',
910
u('root', [
@@ -20,7 +21,7 @@ test('all together now', (t) => {
2021
[u('b', {d: 1}, 'Alpha')]
2122
)
2223

23-
t.deepEqual(
24+
assert.deepEqual(
2425
selectAll(
2526
'[d] ~ c:nth-of-type(even)',
2627
u('root', [
@@ -39,7 +40,7 @@ test('all together now', (t) => {
3940
[u('c', 'Delta'), u('c', 'Hotel')]
4041
)
4142

42-
t.deepEqual(
43+
assert.deepEqual(
4344
selectAll(
4445
'[d] + c:nth-of-type(even)',
4546
u('root', [
@@ -58,7 +59,7 @@ test('all together now', (t) => {
5859
[u('c', 'Delta')]
5960
)
6061

61-
t.deepEqual(
62+
assert.deepEqual(
6263
selectAll(
6364
'[d], :nth-of-type(even), [e]',
6465
u('root', [
@@ -83,6 +84,4 @@ test('all together now', (t) => {
8384
u('b', {e: 3}, 'Alpha')
8485
]
8586
)
86-
87-
t.end()
8887
})

0 commit comments

Comments
 (0)