@@ -19,14 +19,14 @@ describe('avro', () => {
19
19
} )
20
20
test
21
21
. 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 ' ] )
23
23
. exit ( 0 )
24
24
. it ( 'if command not passed' , ctx => {
25
25
expect ( ctx . stdout ) . to . contain ( 'Command is empty or not provided' )
26
26
} )
27
27
test
28
28
. 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' ] )
30
30
. exit ( 0 )
31
31
. it ( 'if command is invalid' , ctx => {
32
32
expect ( ctx . stdout ) . to . contain ( 'Unsupported Command' )
@@ -43,17 +43,12 @@ describe('avro', () => {
43
43
44
44
test
45
45
. 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' ] )
47
47
. exit ( 0 )
48
48
. it ( 'if schema file path is not passed for to_avro' , ctx => {
49
49
expect ( ctx . stdout ) . to . contain ( 'Schema file is not provided' )
50
50
} )
51
51
52
- // positive cases
53
- // 1 - get schema
54
- // 2 - to json
55
- // 3 - to avro
56
-
57
52
/* TODO: why this tests is breaking */
58
53
// test
59
54
// .stdout()
@@ -62,5 +57,22 @@ describe('avro', () => {
62
57
// expect(ctx.stdout).to.contain('success')
63
58
// })
64
59
60
+ // setTimeout(() => // TODO: can we remove it and check if we can resolve promise here
61
+ // expect(ctx.stdout).to.contain(' [[email protected] ] 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
+ } )
65
70
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
+ } )
66
78
} )
0 commit comments