Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

Commit 0af3b42

Browse files
committed
chore: address review comments
1 parent fdad329 commit 0af3b42

File tree

1 file changed

+43
-81
lines changed

1 file changed

+43
-81
lines changed

test/exporter-sharded.spec.js

Lines changed: 43 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,15 @@ describe('exporter sharded', function () {
193193
)
194194
},
195195
(exported, cb) => {
196-
try {
197-
expect(exported.length).to.equal(32)
196+
expect(exported.length).to.equal(32)
198197

199-
const dir = exported.shift()
198+
const dir = exported.shift()
200199

201-
expect(dir.type).to.equal('dir')
200+
expect(dir.type).to.equal('dir')
202201

203-
exported.forEach(file => expect(file.type).to.equal('file'))
202+
exported.forEach(file => expect(file.type).to.equal('file'))
204203

205-
cb()
206-
} catch (e) {
207-
cb(e)
208-
}
204+
cb()
209205
}
210206
], done)
211207
})
@@ -220,17 +216,13 @@ describe('exporter sharded', function () {
220216
)
221217
},
222218
(exported, cb) => {
223-
try {
224-
expect(exported.length).to.equal(1)
219+
expect(exported.length).to.equal(1)
225220

226-
const file = exported.shift()
221+
const file = exported.shift()
227222

228-
expect(file.name).to.deep.equal('file-14')
223+
expect(file.name).to.deep.equal('file-14')
229224

230-
cb()
231-
} catch (e) {
232-
cb(e)
233-
}
225+
cb()
234226
}
235227
], done)
236228
})
@@ -245,17 +237,13 @@ describe('exporter sharded', function () {
245237
)
246238
},
247239
(exported, cb) => {
248-
try {
249-
expect(exported.length).to.equal(1)
240+
expect(exported.length).to.equal(1)
250241

251-
const file = exported.shift()
242+
const file = exported.shift()
252243

253-
expect(file.name).to.deep.equal('file-30')
244+
expect(file.name).to.deep.equal('file-30')
254245

255-
cb()
256-
} catch (e) {
257-
cb(e)
258-
}
246+
cb()
259247
}
260248
], done)
261249
})
@@ -270,17 +258,13 @@ describe('exporter sharded', function () {
270258
)
271259
},
272260
(exported, cb) => {
273-
try {
274-
expect(exported.length).to.equal(1)
261+
expect(exported.length).to.equal(1)
275262

276-
const file = exported.shift()
263+
const file = exported.shift()
277264

278-
expect(file.name).to.deep.equal('file-2567')
265+
expect(file.name).to.deep.equal('file-2567')
279266

280-
cb()
281-
} catch (e) {
282-
cb(e)
283-
}
267+
cb()
284268
}
285269
], done)
286270
})
@@ -297,17 +281,11 @@ describe('exporter sharded', function () {
297281
)
298282
},
299283
(exported, cb) => {
300-
try {
301-
expect(exported.length).to.equal(1)
302-
303-
const entry = exported.pop()
284+
expect(exported.length).to.equal(1)
304285

305-
expect(entry.name).to.deep.equal('baz')
286+
const entry = exported.pop()
306287

307-
cb()
308-
} catch (e) {
309-
cb(e)
310-
}
288+
expect(entry.name).to.deep.equal('baz')
311289
}
312290
], done)
313291
})
@@ -324,17 +302,13 @@ describe('exporter sharded', function () {
324302
)
325303
},
326304
(exported, cb) => {
327-
try {
328-
expect(exported.length).to.equal(1)
305+
expect(exported.length).to.equal(1)
329306

330-
const entry = exported.pop()
307+
const entry = exported.pop()
331308

332-
expect(entry.name).to.deep.equal('bar')
309+
expect(entry.name).to.deep.equal('bar')
333310

334-
cb()
335-
} catch (e) {
336-
cb(e)
337-
}
311+
cb()
338312
}
339313
], done)
340314
})
@@ -351,18 +325,14 @@ describe('exporter sharded', function () {
351325
)
352326
},
353327
(exported, cb) => {
354-
try {
355-
expect(exported.length).to.equal(5)
356-
357-
expect(exported[1].name).to.equal('foo')
358-
expect(exported[2].name).to.equal('bar')
359-
expect(exported[3].name).to.equal('baz')
360-
expect(exported[4].name).to.equal('file-1')
361-
362-
cb()
363-
} catch (e) {
364-
cb(e)
365-
}
328+
expect(exported.length).to.equal(5)
329+
330+
expect(exported[1].name).to.equal('foo')
331+
expect(exported[2].name).to.equal('bar')
332+
expect(exported[3].name).to.equal('baz')
333+
expect(exported[4].name).to.equal('file-1')
334+
335+
cb()
366336
}
367337
], done)
368338
})
@@ -379,20 +349,16 @@ describe('exporter sharded', function () {
379349
)
380350
},
381351
(exported, cb) => {
382-
try {
383-
expect(exported.length).to.equal(35)
352+
expect(exported.length).to.equal(35)
384353

385-
expect(exported[1].name).to.equal('foo')
386-
expect(exported[2].name).to.equal('bar')
387-
expect(exported[3].name).to.equal('baz')
388-
expect(exported[4].name).to.equal('file-14')
354+
expect(exported[1].name).to.equal('foo')
355+
expect(exported[2].name).to.equal('bar')
356+
expect(exported[3].name).to.equal('baz')
357+
expect(exported[4].name).to.equal('file-14')
389358

390-
exported.slice(4).forEach(file => expect(file.type).to.equal('file'))
359+
exported.slice(4).forEach(file => expect(file.type).to.equal('file'))
391360

392-
cb()
393-
} catch (e) {
394-
cb(e)
395-
}
361+
cb()
396362
}
397363
], done)
398364
})
@@ -431,17 +397,13 @@ describe('exporter sharded', function () {
431397
)
432398
},
433399
(exported, cb) => {
434-
try {
435-
expect(exported.length).to.equal(1)
400+
expect(exported.length).to.equal(1)
436401

437-
const entry = exported.pop()
402+
const entry = exported.pop()
438403

439-
expect(entry.name).to.deep.equal('file-1')
404+
expect(entry.name).to.deep.equal('file-1')
440405

441-
cb()
442-
} catch (e) {
443-
cb(e)
444-
}
406+
cb()
445407
}
446408
], done)
447409
})

0 commit comments

Comments
 (0)