Skip to content

Commit

Permalink
Merge pull request #1744 from lamweili/fix-ci
Browse files Browse the repository at this point in the history
ci: fixed broken ci
  • Loading branch information
titanism authored Oct 4, 2022
2 parents d5e5817 + 14b2386 commit 0769a85
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ jobs:
- node-version: 10.x
test-on-old-node: 1
- node-version: 12.x
test-on-old-node: 1
# test-on-brower: 1
- node-version: 14.x
- node-version: 16.x
- node-version: 18.x
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Node - ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand Down Expand Up @@ -58,3 +60,5 @@ jobs:
- name: Coverage On Node ${{ matrix.node-version }}
run:
npm run coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# superagent

[![build status](https://img.shields.io/travis/visionmedia/superagent.svg)](https://travis-ci.org/visionmedia/superagent)
[![code coverage](https://img.shields.io/codecov/c/github/visionmedia/superagent.svg)](https://codecov.io/gh/visionmedia/superagent)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
Expand Down
1 change: 1 addition & 0 deletions ci/remove-deps-4-old-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const UNSUPPORT_DEPS_4_OLD = new Set([
'eslint-plugin-node',
'husky',
'lint-staged',
'marked',
'remark-cli',
'remark-preset-github',
'xo'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"husky": "7",
"lint-staged": "12",
"marked": "^4.1.0",
"mocha": "6.2.2",
"mocha": "^6.2.3",
"multer": "1.4.5-lts.1",
"nyc": "^15.1.0",
"remark-cli": "^11.0.0",
Expand Down Expand Up @@ -122,6 +122,7 @@
"build:dist": "npm run browserify && npm run minify",
"build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib",
"build:test": "babel --config-file ./.test.babelrc test --out-dir lib/node/test",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov",
"lint": "eslint -c .eslintrc src test && remark . -qfo && eslint -c .lib.eslintrc lib/**/*.js && eslint -c .dist.eslintrc dist/**/*.js",
"minify": "cross-env NODE_ENV=production browserify src/node/index.js -o dist/superagent.min.js -s superagent -g [ babelify --configFile ./.dist.babelrc ] -p tinyify",
"nyc": "cross-env NODE_ENV=test nyc ava",
Expand Down
14 changes: 10 additions & 4 deletions test/node/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ describe('req.query(Object)', () => {
});
});

it('query-string should be sent on pipe', function (done) {
this.timeout(15_000);
it('query-string should be sent on pipe', (done) => {
const request_ = request.put(`${base}/?name=tobi`);
const stream = fs.createReadStream('test/node/fixtures/user.json');

Expand All @@ -213,9 +212,16 @@ describe('req.query(Object)', () => {
done(err);
});

stream.on('error', function (err) {
stream.on('error', (err) => {
done(err);
});
stream.pipe(request_);

// wait until stream is valid before piping
stream.on('open', () => {
// wait until request_ is ready before piping
setTimeout(() => {
stream.pipe(request_);
}, 10);
});
});
});

0 comments on commit 0769a85

Please sign in to comment.