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 */
612const 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
1016const 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} ) ;
0 commit comments