Skip to content

Commit

Permalink
refactor: make linter happier (#1671)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmywarting committed Jan 18, 2022
1 parent da714a7 commit 9975981
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,15 @@
}
],
"rules": {
"unicorn/prevent-abbreviations": "warn",
"unicorn/prevent-abbreviations": [
"warn",
{
"replacements": {
"res": false,
"args": false
}
}
],
"no-bitwise": "warn",
"node/prefer-global/buffer": "warn",
"node/prefer-global/process": "warn",
Expand Down
4 changes: 2 additions & 2 deletions test/content-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('req.set("Content-Type", contentType)', function () {
.post(`${uri}/echo`)
.set('Content-Type', 'application/json')
.send({ name: 'tobi' })
.end((error, res) => {
.end((error) => {
assert(!error);
done();
});
Expand All @@ -30,7 +30,7 @@ describe('req.set("Content-Type", contentType)', function () {
.post(`${uri}/echo`)
.set('Content-Type', 'application/json; charset=utf-8')
.send({ name: 'tobi' })
.end((error, res) => {
.end((error) => {
assert(!error);
done();
});
Expand Down
11 changes: 6 additions & 5 deletions test/node/pipe-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ const getSetup = require('../support/setup');
describe('pipe on redirect', () => {
let setup;
let base;
const destPath = 'test/node/fixtures/pipe.txt';
const destinationPath = 'test/node/fixtures/pipe.txt';

before(async () => {
setup = await getSetup();
base = setup.uri;
});

after(function removeTmpfile(done) {
fs.unlink(destPath, done);
after((done) => {
// Remove tmp file
fs.unlink(destinationPath, done);
});

it('should follow Location', (done) => {
const stream = fs.createWriteStream(destPath);
const stream = fs.createWriteStream(destinationPath);
const redirects = [];
const request_ = request
.get(base)
Expand All @@ -30,7 +31,7 @@ describe('pipe on redirect', () => {
});
stream.on('finish', () => {
redirects.should.eql(['/movies', '/movies/all', '/movies/all/0']);
fs.readFileSync(destPath, 'utf8').should.eql('first movie page');
fs.readFileSync(destinationPath, 'utf8').should.eql('first movie page');
done();
});
request_.pipe(stream);
Expand Down
2 changes: 1 addition & 1 deletion test/node/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('req.serialize(fn)', () => {
request
.post(`${base}/echo`)
.send({ foo: 123 })
.serialize((data) => '{"bar":456}')
.serialize(() => '{"bar":456}')
.end((error, res) => {
assert.ifError(error);
assert.equal('{"bar":456}', res.text);
Expand Down
1 change: 1 addition & 0 deletions test/support/express/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const process = require('process');
const express = require('express');

let http2Request;
Expand Down

0 comments on commit 9975981

Please sign in to comment.