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

Commit 99f2583

Browse files
committed
decaffeinate: Run post-processing cleanups on cli-test.coffee and 2 other files
1 parent 414be3c commit 99f2583

File tree

3 files changed

+130
-119
lines changed

3 files changed

+130
-119
lines changed

test/integration/cli-test.js

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
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.
17
/*
28
* decaffeinate suggestions:
39
* DS102: Remove unnecessary code created because of implicit returns
410
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
511
*/
612
const fs = require('fs');
7-
const {assert} = require('chai');
8-
const {exec} = require('child_process');
13+
const { assert } = require('chai');
14+
const { exec } = require('child_process');
915

1016
const cmdPrefix = '';
1117

12-
describe("Command line", function() {
13-
describe("parsing from standard input with --raw", function() {
14-
let stdout = "";
15-
let stderr = "";
16-
let exitStatus = "";
18+
describe('Command line', () => {
19+
describe('parsing from standard input with --raw', () => {
20+
let stdout = '';
21+
let stderr = '';
22+
let exitStatus = '';
1723

18-
before(function(done) {
24+
before((done) => {
1925
const cmd = 'cat ./test/fixtures/get/tracefile | ' +
2026
'./bin/curl-trace-parser --raw';
2127

22-
const cli = exec(cmdPrefix + cmd, function(error, out, err) {
28+
const cli = exec(cmdPrefix + cmd, (error, out, err) => {
2329
stdout = out;
2430
stderr = err;
2531
if (error) {
@@ -31,29 +37,29 @@ describe("Command line", function() {
3137
return cli.on('exit', code => exitStatus = code);
3238
});
3339

34-
it("should not return nothing to stderr", () => assert.equal(stderr, ""));
40+
it('should not return nothing to stderr', () => assert.equal(stderr, ''));
3541

36-
it("should return with exit code 0", function() {});
42+
it('should return with exit code 0', () => {});
3743

38-
return it("should return parsed body to standard output", function(done) {
39-
const expectedOutputPath = "./test/fixtures/get/expected-output";
40-
return fs.readFile(expectedOutputPath, 'utf8', function(err, expected) {
44+
return it('should return parsed body to standard output', (done) => {
45+
const expectedOutputPath = './test/fixtures/get/expected-output';
46+
return fs.readFile(expectedOutputPath, 'utf8', (err, expected) => {
4147
assert.equal(stdout, expected);
4248
return done();
4349
});
4450
});
4551
});
4652

47-
describe("parsing from standard input with --blueprint option", function() {
48-
let stdout = "";
49-
let stderr = "";
50-
let exitStatus = "";
53+
describe('parsing from standard input with --blueprint option', () => {
54+
let stdout = '';
55+
let stderr = '';
56+
let exitStatus = '';
5157

52-
before(function(done) {
58+
before((done) => {
5359
const cmd = 'cat ./test/fixtures/post/tracefile | ' +
5460
'./bin/curl-trace-parser --blueprint';
5561

56-
const cli = exec(cmdPrefix + cmd, function(error, out, err) {
62+
const cli = exec(cmdPrefix + cmd, (error, out, err) => {
5763
stdout = out;
5864
stderr = err;
5965
if (error) {
@@ -65,28 +71,27 @@ describe("Command line", function() {
6571
return cli.on('exit', code => exitStatus = code);
6672
});
6773

68-
it("should not return nothing to stderr", () => assert.equal(stderr, ""));
74+
it('should not return nothing to stderr', () => assert.equal(stderr, ''));
6975

70-
it("should return with exit code 0", function() {});
76+
it('should return with exit code 0', () => {});
7177

72-
return it("should return parsed body in API Blueprint format to standard output", function(done) {
73-
const expectedOutputPath = "./test/fixtures/post/expected-output.md";
74-
return fs.readFile(expectedOutputPath, 'utf8', function(err, expected) {
78+
return it('should return parsed body in API Blueprint format to standard output', (done) => {
79+
const expectedOutputPath = './test/fixtures/post/expected-output.md';
80+
return fs.readFile(expectedOutputPath, 'utf8', (err, expected) => {
7581
assert.equal(stdout, expected);
7682
return done();
7783
});
7884
});
7985
});
8086

81-
return describe("no input on stdin and no options", function(){
87+
return describe('no input on stdin and no options', () => {
88+
let stdout = '';
89+
let stderr = '';
90+
let exitStatus = '';
8291

83-
let stdout = "";
84-
let stderr = "";
85-
let exitStatus = "";
86-
87-
before(function(done) {
88-
const cmd = './bin/curl-trace-parser';
89-
const cli = exec(cmdPrefix + cmd, function(error, out, err) {
92+
before((done) => {
93+
const cmd = './bin/curl-trace-parser';
94+
const cli = exec(cmdPrefix + cmd, (error, out, err) => {
9095
stdout = out;
9196
stderr = err;
9297
if (error) {
@@ -95,15 +100,15 @@ describe("Command line", function() {
95100
});
96101

97102

98-
return cli.on('exit', function(code) {
103+
return cli.on('exit', (code) => {
99104
exitStatus = code;
100105
return done();
101106
});
102107
});
103108

104109

105-
it("should exit with status 1", () => assert.equal(exitStatus, 1));
110+
it('should exit with status 1', () => assert.equal(exitStatus, 1));
106111

107-
return it("should return error message to stderr", () => assert.include(stderr, "No input on stdin"));
112+
return it('should return error message to stderr', () => assert.include(stderr, 'No input on stdin'));
108113
});
109114
});

test/integration/js-api-test.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
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.
17
/*
28
* decaffeinate suggestions:
39
* DS102: Remove unnecessary code created because of implicit returns
410
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
511
*/
612
const fs = require('fs');
713

8-
const {assert} = require('chai');
9-
const {exec} = require('child_process');
14+
const { assert } = require('chai');
15+
const { exec } = require('child_process');
1016
const parser = require('../../lib/parser');
1117

12-
describe("Javascript API", () =>
13-
describe("parsing from file", () =>
18+
describe('Javascript API', () =>
19+
describe('parsing from file', () =>
1420

15-
it("should return expected raw HTTP in format described in Readme", function(done) {
16-
const traceFilePath = "./test/fixtures/get/tracefile";
17-
const expectedOutputPath = "./test/fixtures/get/expected-output";
21+
it('should return expected raw HTTP in format described in Readme', (done) => {
22+
const traceFilePath = './test/fixtures/get/tracefile';
23+
const expectedOutputPath = './test/fixtures/get/expected-output';
1824

19-
return fs.readFile(traceFilePath, 'utf8', function(err,trace) {
25+
return fs.readFile(traceFilePath, 'utf8', (err, trace) => {
2026
const parsed = parser.parseToString(trace);
21-
return fs.readFile(expectedOutputPath, 'utf8', function(err,expected) {
27+
return fs.readFile(expectedOutputPath, 'utf8', (err, expected) => {
2228
assert.equal(parsed, expected);
2329
return done();
2430
});
2531
});
26-
})
27-
)
28-
);
32+
})));

0 commit comments

Comments
 (0)