@@ -19,14 +19,14 @@ describe('avro', () => {
1919 } )
2020 test
2121 . stdout ( )
22- . command ( [ 'avro' , '-f' , 'test/resources/avro/person.avro' , '-o' , 'output_file.example ' ] )
22+ . command ( [ 'avro' , '-f' , 'test/resources/avro/person.avro' , '-o' , 'test/resources/avro/output/person.json ' ] )
2323 . exit ( 0 )
2424 . it ( 'if command not passed' , ctx => {
2525 expect ( ctx . stdout ) . to . contain ( 'Command is empty or not provided' )
2626 } )
2727 test
2828 . stdout ( )
29- . command ( [ 'avro' , '-f' , 'test/resources/avro/person.avro' , '-o' , 'output_file.example ' , 'unsupported_command' ] )
29+ . command ( [ 'avro' , '-f' , 'test/resources/avro/person.avro' , '-o' , 'test/resources/avro/output/person.json ' , 'unsupported_command' ] )
3030 . exit ( 0 )
3131 . it ( 'if command is invalid' , ctx => {
3232 expect ( ctx . stdout ) . to . contain ( 'Unsupported Command' )
@@ -43,17 +43,12 @@ describe('avro', () => {
4343
4444 test
4545 . stdout ( )
46- . command ( [ 'avro' , '-f' , 'test/resources/avro/person.avro ' , '-o' , 'output_file.example ' , 'to_avro' ] )
46+ . command ( [ 'avro' , '-f' , 'test/resources/avro/person.json ' , '-o' , 'test/resources/avro/output/person.avro ' , 'to_avro' ] )
4747 . exit ( 0 )
4848 . it ( 'if schema file path is not passed for to_avro' , ctx => {
4949 expect ( ctx . stdout ) . to . contain ( 'Schema file is not provided' )
5050 } )
5151
52- // positive cases
53- // 1 - get schema
54- // 2 - to json
55- // 3 - to avro
56-
5752 /* TODO: why this tests is breaking */
5853 // test
5954 // .stdout()
@@ -62,5 +57,22 @@ describe('avro', () => {
6257 // expect(ctx.stdout).to.contain('success')
6358 // })
6459
60+ // setTimeout(() => // TODO: can we remove it and check if we can resolve promise here
61+ // expect(ctx.stdout).to.contain(' [react@16.10.2] minified:6.5 kB gzip:2.6 kB')
62+ // , 5000) // proving 5 seconds just to be safe
63+
64+ test
65+ . stdout ( )
66+ . command ( [ 'avro' , '-f' , 'test/resources/avro/person.avro' , '-o' , 'test/resources/avro/output/person.json' , 'to_json' ] )
67+ . it ( 'if to_json commands run with success' , ctx => {
68+ expect ( ctx . stdout ) . to . contain ( 'success' )
69+ } )
6570
71+ test
72+ . timeout ( 20000 ) // added timeout to resolve timeout problem
73+ . stdout ( )
74+ . command ( [ 'avro' , '-f' , 'test/resources/avro/person.json' , '-o' , 'test/resources/avro/output/person.avro' , '-t' , 'test/resources/avro/person.avsc' , 'to_avro' ] )
75+ . it ( 'if to_avro commands run with success' , ctx => {
76+ expect ( ctx . stdout ) . to . contain ( 'success' )
77+ } )
6678} )
0 commit comments