Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 3f3e77d

Browse files
committed
Fix lint errors found by eslint.
Adds some missing assertions that eslint found.
1 parent 8715d79 commit 3f3e77d

File tree

3 files changed

+13
-37
lines changed

3 files changed

+13
-37
lines changed

test/integration/cli-test.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/* eslint-disable
2-
no-return-assign,
3-
no-unused-vars,
4-
*/
5-
// TODO: This file was created by bulk-decaffeinate.
6-
// Fix any style issues and re-enable lint.
71
const fs = require('fs');
82
const { assert } = require('chai');
93
const { exec } = require('child_process');
@@ -29,12 +23,12 @@ describe('Command line', () => {
2923
done();
3024
});
3125

32-
cli.on('exit', code => exitStatus = code);
26+
cli.on('exit', (code) => { exitStatus = code; });
3327
});
3428

3529
it('should not return nothing to stderr', () => assert.equal(stderr, ''));
3630

37-
it('should return with exit code 0', () => {});
31+
it('should return with exit code 0', () => assert.equal(exitStatus, 0));
3832

3933
it('should return parsed body to standard output', (done) => {
4034
const expectedOutputPath = './test/fixtures/get/expected-output';
@@ -63,12 +57,12 @@ describe('Command line', () => {
6357
done();
6458
});
6559

66-
cli.on('exit', code => exitStatus = code);
60+
cli.on('exit', (code) => { exitStatus = code; });
6761
});
6862

6963
it('should not return nothing to stderr', () => assert.equal(stderr, ''));
7064

71-
it('should return with exit code 0', () => {});
65+
it('should return with exit code 0', () => assert.equal(exitStatus, 0));
7266

7367
it('should return parsed body in API Blueprint format to standard output', (done) => {
7468
const expectedOutputPath = './test/fixtures/post/expected-output.md';
@@ -80,14 +74,12 @@ describe('Command line', () => {
8074
});
8175

8276
describe('no input on stdin and no options', () => {
83-
let stdout = '';
8477
let stderr = '';
8578
let exitStatus = '';
8679

8780
before((done) => {
8881
const cmd = './bin/curl-trace-parser';
8982
const cli = exec(cmdPrefix + cmd, (error, out, err) => {
90-
stdout = out;
9183
stderr = err;
9284
if (error) {
9385
exitStatus = error.code;

test/integration/js-api-test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
/* eslint-disable
2-
no-shadow,
3-
no-unused-vars,
4-
*/
5-
// TODO: This file was created by bulk-decaffeinate.
6-
// Fix any style issues and re-enable lint.
7-
81
const fs = require('fs');
92

103
const { assert } = require('chai');
11-
const { exec } = require('child_process');
124
const parser = require('../../lib/parser');
135

146
describe('Javascript API', () =>
@@ -20,7 +12,7 @@ describe('Javascript API', () =>
2012

2113
fs.readFile(traceFilePath, 'utf8', (err, trace) => {
2214
const parsed = parser.parseToString(trace);
23-
fs.readFile(expectedOutputPath, 'utf8', (err, expected) => {
15+
fs.readFile(expectedOutputPath, 'utf8', (error, expected) => {
2416
assert.equal(parsed, expected);
2517
done();
2618
});

test/unit/parser-test.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/* eslint-disable
2-
no-return-assign,
3-
prefer-destructuring,
4-
*/
5-
// TODO: This file was created by bulk-decaffeinate.
6-
// Fix any style issues and re-enable lint.
7-
81
const fs = require('fs');
92
const { assert } = require('chai');
103
const parser = require('../../lib/parser');
@@ -23,7 +16,7 @@ describe('parser module', () => {
2316
it('has parse() defined', () => assert.isFunction(parser.parse));
2417

2518
describe('parse(string) return', () => {
26-
before(() => output = parser.parse(trace));
19+
before(() => { output = parser.parse(trace); });
2720

2821
it('is obejct', () => assert.isObject(output));
2922

@@ -34,7 +27,7 @@ describe('parser module', () => {
3427

3528
describe('parsed request', () => {
3629
let request = '';
37-
before(() => request = output.request);
30+
before(() => { ({ request } = output); });
3831

3932
it('contains multiple lines delimited by CRLF', () => {
4033
const lines = request.split('\r\n');
@@ -46,7 +39,6 @@ describe('parser module', () => {
4639
assert.include(request, agentString);
4740
});
4841

49-
5042
it('does not contain double LF at the end', () => {
5143
const outputChars = request.split('');
5244

@@ -59,7 +51,7 @@ describe('parser module', () => {
5951

6052
describe('parsed response', () => {
6153
let response = '';
62-
before(() => response = output.response);
54+
before(() => { ({ response } = output); });
6355

6456
it('containt application/json', () => {
6557
const string = 'application/json';
@@ -77,7 +69,7 @@ describe('parser module', () => {
7769
it('has parseToString() defined', () => assert.isFunction(parser.parseToString));
7870

7971
describe('parseToString(traceString) return', () => {
80-
before(() => output = parser.parseToString(trace));
72+
before(() => { output = parser.parseToString(trace); });
8173

8274
it('should have trailing LF as last character to do not brake terminal', () => {
8375
const outputChars = output.split('');
@@ -99,7 +91,7 @@ describe('parser module', () => {
9991
});
10092

10193
it("should have all parsed Request lines leaded by '> '", () => {
102-
const request = parser.parse(trace).request;
94+
const { request } = parser.parse(trace);
10395

10496
let counter = 0;
10597
for (const line of request.split('\r\n')) {
@@ -110,7 +102,7 @@ describe('parser module', () => {
110102
});
111103

112104
it("should have all parsed Response lines leaded by '< '", () => {
113-
const response = parser.parse(trace).response;
105+
const { response } = parser.parse(trace);
114106

115107
let counter = 0;
116108
for (const line of response.split('\r\n')) {
@@ -142,7 +134,7 @@ describe('parser module', () => {
142134

143135
describe('parsed request', () => {
144136
let request = '';
145-
before(() => request = output.request);
137+
before(() => { ({ request } = output); });
146138

147139
it('is a string', () => assert.isString(request));
148140

@@ -151,7 +143,7 @@ describe('parser module', () => {
151143

152144
describe('parsed response', () => {
153145
let response = '';
154-
before(() => response = output.response);
146+
before(() => { ({ response } = output); });
155147

156148
it('is a string', () => assert.isString(response));
157149

0 commit comments

Comments
 (0)