Skip to content

Commit e851881

Browse files
authored
test: migrate from tape to node test runner (#24)
1 parent 09a279b commit e851881

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎package.json‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"build": "true",
99
"test:ci": "npm run test",
10-
"test": "node test.js"
10+
"test": "node --test test.js"
1111
},
1212
"repository": {
1313
"type": "git",
@@ -31,8 +31,7 @@
3131
"list-stream": "^2.1.0",
3232
"readable-stream": "^4.3.0",
3333
"semantic-release": "^25.0.3",
34-
"split2": "^4.2.0",
35-
"tape": "^5.6.3"
34+
"split2": "^4.2.0"
3635
},
3736
"dependencies": {
3837
"strip-ansi": "^7.0.1",

‎test.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import commitStream from './commit-stream.js'
22
import { spawn, exec } from 'node:child_process'
3-
import test from 'tape'
3+
import assert from 'node:assert/strict'
4+
import nodeTest from 'node:test'
45
import split2 from 'split2'
56
import listStream from 'list-stream'
67
import { pipeline } from 'readable-stream'
78
import bl from 'bl'
89

10+
function test (name, fn) {
11+
return nodeTest(name, (_, done) => fn({
12+
...assert,
13+
end: done,
14+
error: assert.ifError
15+
}))
16+
}
17+
918
function gitToList (t, gitCmd, user, repo, callback) {
1019
if (typeof user === 'function') {
1120
callback = user

0 commit comments

Comments
 (0)