-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Worker tests && Worker shutdown && many methods > 10
- Loading branch information
Showing
10 changed files
with
470 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--timeout 10000 | ||
--timeout 20000 | ||
--retries 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// setup chai | ||
const chai = require('chai') | ||
chai.use(require('dirty-chai')) | ||
const expect = chai.expect | ||
|
||
const utils = require('../lib/utils') | ||
|
||
describe('_utils', () => { | ||
describe('#flatten()', () => { | ||
it('should flatten arrays', async function () { | ||
const arrs = [[1, 2], [3], [4, 5]] | ||
const flatArr = utils.flatten(arrs) | ||
expect(flatArr).to.eql([1, 2, 3, 4, 5]) | ||
}) | ||
}) | ||
|
||
describe('#chunk()', () => { | ||
it('should allow chunking empty array', async function () { | ||
expect(utils.chunk([])).to.eql([]) | ||
}) | ||
|
||
it('should chunk array to size', async function () { | ||
const arr = [1, 2, 3, 4, 5] | ||
const chunks = utils.chunk(arr, 2) | ||
expect(chunks).to.deep.eql([[1, 2], [3, 4], [5]]) | ||
}) | ||
}) | ||
|
||
describe('#chunkNumber()', () => { | ||
it('should chunk number to exact slices', async function () { | ||
const chunks = utils.chunkNumber(6, 2) | ||
expect(chunks).to.eql([2, 2, 2]) | ||
}) | ||
|
||
it('should chunk number with extra slices', async function () { | ||
const chunks = utils.chunkNumber(7, 2) | ||
expect(chunks).to.eql([2, 2, 2, 1]) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.