Skip to content

Commit 881f61b

Browse files
author
Stephen Belanger
committed
Update deps and add code coverage testing
1 parent a074e76 commit 881f61b

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

.codecov.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Disable comments on Pull Requests
2+
comment: false

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
.DS_Store
12
node_modules
23
package-lock.json
4+
.nyc_output
5+
coverage

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
sudo: false
21
language: node_js
32
node_js:
43
- 11
54
- 10
5+
after_success: npm run coverage

package.json

+16-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "Pipe between async iterators and streams",
55
"main": "index.js",
66
"scripts": {
7-
"test": "tap test.js"
7+
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
8+
"test": "standard && nyc tap test.js"
89
},
910
"keywords": [
1011
"async",
@@ -15,6 +16,18 @@
1516
"author": "Stephen Belanger <[email protected]> (https://github.com/qard)",
1617
"license": "MIT",
1718
"devDependencies": {
18-
"tap": "^12.5.2"
19-
}
19+
"codecov": "^3.2.0",
20+
"nyc": "^13.3.0",
21+
"standard": "^12.0.1",
22+
"tap": "^12.6.1"
23+
},
24+
"dependencies": {},
25+
"repository": {
26+
"type": "git",
27+
"url": "git+https://github.com/Qard/async-iterator-pipe.git"
28+
},
29+
"bugs": {
30+
"url": "https://github.com/Qard/async-iterator-pipe/issues"
31+
},
32+
"homepage": "https://github.com/Qard/async-iterator-pipe#readme"
2033
}

test.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const tap = require('tap')
44

55
const pipe = require('./')
66

7-
async function* produceIterator (n) {
7+
async function * produceIterator (n) {
88
for (let i = 0; i < n; i++) {
99
yield `produced "${i}"\n`
1010
}
@@ -20,7 +20,7 @@ function produceStream (n) {
2020
return stream
2121
}
2222

23-
async function* splitLines (iterator) {
23+
async function * splitLines (iterator) {
2424
let buffer = ''
2525
for await (let item of iterator) {
2626
buffer += item
@@ -56,11 +56,10 @@ tap.test('stream -> iterator', async t => {
5656
t.equal(chunk, `produced "${i++}"\n`)
5757
}
5858
})
59-
6059
tap.test('iterator -> iterator', async t => {
6160
t.plan(5)
6261

63-
async function* upper (iterator) {
62+
async function * upper (iterator) {
6463
for await (let item of iterator) {
6564
yield item.toString().toUpperCase()
6665
}

0 commit comments

Comments
 (0)