@@ -7,7 +7,6 @@ var unzip = require('../../lib/unzip');
7
7
var fixtures = {
8
8
sb : path . resolve ( __dirname , '../fixtures/data/_example.sb' ) ,
9
9
sb2 : path . resolve ( __dirname , '../fixtures/data/_example.sb2' ) ,
10
- gzipJSON : path . resolve ( __dirname , '../fixtures/data/_example.json.gz' ) ,
11
10
zipFakeProjectJSON :
12
11
path . resolve ( __dirname , '../fixtures/data/_zipFakeProjectJson.zip' ) ,
13
12
zipNoProjectJSON :
@@ -28,7 +27,7 @@ test('spec', function (t) {
28
27
29
28
test ( 'sb' , function ( t ) {
30
29
var buffer = new Buffer ( fixtures . sb ) ;
31
- unzip ( buffer , false , false , function ( err , res ) {
30
+ unzip ( buffer , false , function ( err , res ) {
32
31
t . type ( err , 'string' ) ;
33
32
t . equal ( err . startsWith ( errorMessage ) , true ) ;
34
33
t . type ( res , 'undefined' ) ;
@@ -38,7 +37,7 @@ test('sb', function (t) {
38
37
39
38
test ( 'sb2' , function ( t ) {
40
39
var buffer = new Buffer ( fixtures . sb2 ) ;
41
- unzip ( buffer , false , false , function ( err , res ) {
40
+ unzip ( buffer , false , function ( err , res ) {
42
41
t . equal ( err , null ) ;
43
42
t . equal ( Array . isArray ( res ) , true ) ;
44
43
t . type ( res [ 0 ] , 'string' ) ;
@@ -50,23 +49,9 @@ test('sb2', function (t) {
50
49
} ) ;
51
50
} ) ;
52
51
53
- test ( 'gzipped JSON' , function ( t ) {
54
- var buffer = new Buffer ( fixtures . gzipJSON ) ;
55
- unzip ( buffer , true , false , function ( err , res ) {
56
- t . equal ( err , null ) ;
57
- t . equal ( Array . isArray ( res ) , true ) ;
58
- t . type ( res [ 0 ] , 'string' ) ;
59
- t . doesNotThrow ( function ( ) {
60
- JSON . parse ( res [ 0 ] ) ;
61
- } ) ;
62
- t . equal ( res [ 1 ] , null ) ;
63
- t . end ( ) ;
64
- } ) ;
65
- } ) ;
66
-
67
52
test ( 'sb2 with nested folder' , function ( t ) {
68
53
var buffer = new Buffer ( fixtures . sb2Nested ) ;
69
- unzip ( buffer , false , false , function ( err , res ) {
54
+ unzip ( buffer , false , function ( err , res ) {
70
55
t . equal ( err , null ) ;
71
56
t . equal ( Array . isArray ( res ) , true ) ;
72
57
t . type ( res [ 0 ] , 'string' ) ;
@@ -80,7 +65,7 @@ test('sb2 with nested folder', function (t) {
80
65
81
66
test ( 'zip without project json' , function ( t ) {
82
67
var buffer = new Buffer ( fixtures . zipNoProjectJSON ) ;
83
- unzip ( buffer , false , false , function ( err , res ) {
68
+ unzip ( buffer , false , function ( err , res ) {
84
69
t . type ( err , 'string' ) ;
85
70
t . equal ( err . startsWith ( errorMessage ) , true ) ;
86
71
t . type ( res , 'undefined' ) ;
@@ -90,7 +75,7 @@ test('zip without project json', function (t) {
90
75
91
76
test ( 'zip with fake project json' , function ( t ) {
92
77
var buffer = new Buffer ( fixtures . zipFakeProjectJSON ) ;
93
- unzip ( buffer , false , false , function ( err , res ) {
78
+ unzip ( buffer , false , function ( err , res ) {
94
79
t . equal ( err , null ) ;
95
80
t . equal ( Array . isArray ( res ) , true ) ;
96
81
t . type ( res [ 0 ] , 'string' ) ;
@@ -106,7 +91,7 @@ test('zip with fake project json', function (t) {
106
91
var randomString = 'this is not a zip' ;
107
92
108
93
test ( 'random string instead of zip, whole project' , function ( t ) {
109
- unzip ( randomString , false , false , function ( err , res ) {
94
+ unzip ( randomString , false , function ( err , res ) {
110
95
t . type ( err , 'string' ) ;
111
96
t . equal ( err . startsWith ( errorMessage ) , true ) ;
112
97
t . type ( res , 'undefined' ) ;
@@ -115,25 +100,7 @@ test('random string instead of zip, whole project', function (t) {
115
100
} ) ;
116
101
117
102
test ( 'random string instead of zip, sprite' , function ( t ) {
118
- unzip ( randomString , false , true , function ( err , res ) {
119
- t . type ( err , 'string' ) ;
120
- t . equal ( err . startsWith ( errorMessage ) , true ) ;
121
- t . type ( res , 'undefined' ) ;
122
- t . end ( ) ;
123
- } ) ;
124
- } ) ;
125
-
126
- test ( 'random string instead of gzip, whole project ' , function ( t ) {
127
- unzip ( randomString , true , false , function ( err , res ) {
128
- t . type ( err , 'string' ) ;
129
- t . equal ( err . startsWith ( errorMessage ) , true ) ;
130
- t . type ( res , 'undefined' ) ;
131
- t . end ( ) ;
132
- } ) ;
133
- } ) ;
134
-
135
- test ( 'random string instead of gzip, sprite' , function ( t ) {
136
- unzip ( randomString , true , true , function ( err , res ) {
103
+ unzip ( randomString , true , function ( err , res ) {
137
104
t . type ( err , 'string' ) ;
138
105
t . equal ( err . startsWith ( errorMessage ) , true ) ;
139
106
t . type ( res , 'undefined' ) ;
@@ -143,17 +110,7 @@ test('random string instead of gzip, sprite', function (t) {
143
110
144
111
test ( 'undefined' , function ( t ) {
145
112
var foo ;
146
- unzip ( foo , false , false , function ( err , obj ) {
147
- t . type ( err , 'string' ) ;
148
- t . equal ( err . startsWith ( errorMessage ) , true ) ;
149
- t . type ( obj , 'undefined' ) ;
150
- t . end ( ) ;
151
- } ) ;
152
- } ) ;
153
-
154
- test ( 'undefined isGZip' , function ( t ) {
155
- var foo ;
156
- unzip ( foo , true , false , function ( err , obj ) {
113
+ unzip ( foo , false , function ( err , obj ) {
157
114
t . type ( err , 'string' ) ;
158
115
t . equal ( err . startsWith ( errorMessage ) , true ) ;
159
116
t . type ( obj , 'undefined' ) ;
@@ -162,7 +119,7 @@ test('undefined isGZip', function (t) {
162
119
} ) ;
163
120
164
121
test ( 'null instead of zip, whole project' , function ( t ) {
165
- unzip ( null , false , false , function ( err , obj ) {
122
+ unzip ( null , false , function ( err , obj ) {
166
123
t . type ( err , 'string' ) ;
167
124
t . equal ( err . startsWith ( errorMessage ) , true ) ;
168
125
t . type ( obj , 'undefined' ) ;
@@ -171,25 +128,7 @@ test('null instead of zip, whole project', function (t) {
171
128
} ) ;
172
129
173
130
test ( 'null instead of zip, sprite' , function ( t ) {
174
- unzip ( null , false , true , function ( err , obj ) {
175
- t . type ( err , 'string' ) ;
176
- t . equal ( err . startsWith ( errorMessage ) , true ) ;
177
- t . type ( obj , 'undefined' ) ;
178
- t . end ( ) ;
179
- } ) ;
180
- } ) ;
181
-
182
- test ( 'null instead of gzip, whole project' , function ( t ) {
183
- unzip ( null , true , false , function ( err , obj ) {
184
- t . type ( err , 'string' ) ;
185
- t . equal ( err . startsWith ( errorMessage ) , true ) ;
186
- t . type ( obj , 'undefined' ) ;
187
- t . end ( ) ;
188
- } ) ;
189
- } ) ;
190
-
191
- test ( 'null instead of gzip, sprite' , function ( t ) {
192
- unzip ( null , true , true , function ( err , obj ) {
131
+ unzip ( null , true , function ( err , obj ) {
193
132
t . type ( err , 'string' ) ;
194
133
t . equal ( err . startsWith ( errorMessage ) , true ) ;
195
134
t . type ( obj , 'undefined' ) ;
@@ -198,7 +137,7 @@ test('null instead of gzip, sprite', function (t) {
198
137
} ) ;
199
138
200
139
test ( 'object instead of zip, whole project' , function ( t ) {
201
- unzip ( { } , false , false , function ( err , obj ) {
140
+ unzip ( { } , false , function ( err , obj ) {
202
141
t . type ( err , 'string' ) ;
203
142
t . equal ( err . startsWith ( errorMessage ) , true ) ;
204
143
t . type ( obj , 'undefined' ) ;
@@ -207,25 +146,7 @@ test('object instead of zip, whole project', function (t) {
207
146
} ) ;
208
147
209
148
test ( 'object instead of zip, sprite' , function ( t ) {
210
- unzip ( { } , false , true , function ( err , obj ) {
211
- t . type ( err , 'string' ) ;
212
- t . equal ( err . startsWith ( errorMessage ) , true ) ;
213
- t . type ( obj , 'undefined' ) ;
214
- t . end ( ) ;
215
- } ) ;
216
- } ) ;
217
-
218
- test ( 'object instead of gzip, whole project' , function ( t ) {
219
- unzip ( { } , true , false , function ( err , obj ) {
220
- t . type ( err , 'string' ) ;
221
- t . equal ( err . startsWith ( errorMessage ) , true ) ;
222
- t . type ( obj , 'undefined' ) ;
223
- t . end ( ) ;
224
- } ) ;
225
- } ) ;
226
-
227
- test ( 'object instead of gzip, sprite' , function ( t ) {
228
- unzip ( { } , true , false , function ( err , obj ) {
149
+ unzip ( { } , true , function ( err , obj ) {
229
150
t . type ( err , 'string' ) ;
230
151
t . equal ( err . startsWith ( errorMessage ) , true ) ;
231
152
t . type ( obj , 'undefined' ) ;
0 commit comments