@@ -7,16 +7,6 @@ describe('CSV Read component', function () {
7
7
var Q = require ( 'q' ) ;
8
8
var fs = require ( "fs" ) ;
9
9
10
-
11
- it ( 'empty body' , function ( done ) {
12
- runTest ( csv . process , { } , { } , function ( runner ) {
13
- expect ( runner . data . length ) . toEqual ( 0 ) ;
14
- expect ( runner . errors . length ) . toEqual ( 1 ) ;
15
- expect ( runner . snapshot ) . toBeUndefined ( ) ;
16
- done ( ) ;
17
- } ) ;
18
- } ) ;
19
-
20
10
nock ( 'http://test.env.mock' )
21
11
. get ( '/simple.csv' )
22
12
. replyWithFile ( 200 , __dirname + '/test/simple.csv' ) ;
@@ -30,14 +20,33 @@ describe('CSV Read component', function () {
30
20
. replyWithFile ( 200 , __dirname + '/test/numbers.csv' ) ;
31
21
32
22
nock ( 'http://test.env.mock' )
33
- . get ( '/numbers .csv' )
23
+ . get ( '/numbers_us .csv' )
34
24
. replyWithFile ( 200 , __dirname + '/test/numbers_us.csv' ) ;
35
25
36
26
nock ( 'http://test.env.mock' )
37
- . get ( '/numbers .csv' )
27
+ . get ( '/numbers_de .csv' )
38
28
. replyWithFile ( 200 , __dirname + '/test/numbers_de.csv' ) ;
39
29
40
- it ( 'should parse simple string rows' , function ( ) {
30
+ function expectDate ( date , year , month , day , minutes , seconds ) {
31
+ expect ( date . getUTCFullYear ( ) ) . toEqual ( year ) ;
32
+ expect ( date . getUTCMonth ( ) ) . toEqual ( month ) ;
33
+ expect ( date . getUTCDate ( ) ) . toEqual ( day ) ;
34
+ expect ( date . getUTCMinutes ( ) ) . toEqual ( minutes ) ;
35
+ expect ( date . getUTCSeconds ( ) ) . toEqual ( seconds ) ;
36
+ }
37
+
38
+
39
+ it ( 'empty body' , function ( done ) {
40
+ runTest ( csv . process , { } , { } , function ( runner ) {
41
+ expect ( runner . data . length ) . toEqual ( 0 ) ;
42
+ expect ( runner . errors . length ) . toEqual ( 1 ) ;
43
+ expect ( runner . snapshot ) . toBeUndefined ( ) ;
44
+ done ( ) ;
45
+ } ) ;
46
+ } ) ;
47
+
48
+
49
+ it ( 'should parse simple string rows' , function ( done ) {
41
50
42
51
var cfg = {
43
52
reader : {
@@ -68,11 +77,11 @@ describe('CSV Read component', function () {
68
77
69
78
expect ( runner . errors . length ) . toEqual ( 0 ) ;
70
79
expect ( runner . snapshot ) . toBeUndefined ( ) ;
71
-
80
+ done ( ) ;
72
81
} ) ;
73
82
} ) ;
74
83
75
- it ( "should parse simple date rows" , function ( ) {
84
+ it ( "should parse simple date rows" , function ( done ) {
76
85
77
86
var msg = {
78
87
} ;
@@ -112,19 +121,13 @@ describe('CSV Read component', function () {
112
121
expect ( runner . errors . length ) . toEqual ( 0 ) ;
113
122
expect ( runner . snapshot ) . toBeUndefined ( ) ;
114
123
124
+ done ( ) ;
125
+
115
126
} ) ;
116
127
} ) ;
117
128
118
- var expectDate = function ( date , year , month , day , minutes , seconds ) {
119
-
120
- expect ( date . getUTCFullYear ( ) ) . toEqual ( year ) ;
121
- expect ( date . getUTCMonth ( ) ) . toEqual ( month ) ;
122
- expect ( date . getUTCDate ( ) ) . toEqual ( day ) ;
123
- expect ( date . getUTCMinutes ( ) ) . toEqual ( minutes ) ;
124
- expect ( date . getUTCSeconds ( ) ) . toEqual ( seconds ) ;
125
- } ;
126
129
127
- it ( "should parse simple number rows" , function ( ) {
130
+ it ( "should parse simple number rows" , function ( done ) {
128
131
129
132
var msg = { } ;
130
133
@@ -164,10 +167,11 @@ describe('CSV Read component', function () {
164
167
expect ( runner . errors . length ) . toEqual ( 0 ) ;
165
168
expect ( runner . snapshot ) . toBeUndefined ( ) ;
166
169
170
+ done ( ) ;
167
171
} ) ;
168
172
} ) ;
169
173
170
- it ( "should parse US numbers" , function ( ) {
174
+ it ( "should parse US numbers" , function ( done ) {
171
175
172
176
var msg = { } ;
173
177
@@ -201,11 +205,11 @@ describe('CSV Read component', function () {
201
205
expect ( runner . errors . length ) . toEqual ( 0 ) ;
202
206
expect ( runner . snapshot ) . toBeUndefined ( ) ;
203
207
204
- expect ( s3 . getEncrypted ) . toHaveBeenCalledWith ( "loremipsum.fubar" ) ;
208
+ done ( ) ;
205
209
} ) ;
206
210
} ) ;
207
211
208
- it ( "should parse DE numbers" , function ( ) {
212
+ it ( "should parse DE numbers" , function ( done ) {
209
213
var msg = { } ;
210
214
211
215
var cfg = {
@@ -245,6 +249,7 @@ describe('CSV Read component', function () {
245
249
expect ( runner . errors . length ) . toEqual ( 0 ) ;
246
250
expect ( runner . snapshot ) . toBeUndefined ( ) ;
247
251
252
+ done ( ) ;
248
253
} ) ;
249
254
} ) ;
250
255
0 commit comments