Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fixed broken ci #1744

Merged
merged 6 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});
});
});