mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 21:07:46 +00:00
[tests] Run unit tests concurrently in chunks (#9615)
We can separate each package `test-unit` into a separate job. This will help isolate problems and we can re-run CI for a specific package.
This commit is contained in:
17
utils/chunk-tests.test.js
vendored
17
utils/chunk-tests.test.js
vendored
@@ -3,16 +3,27 @@ const { intoChunks } = require('./chunk-tests');
|
||||
describe('it should create chunks correctly', () => {
|
||||
it('should split chunks correctly less chunks than items', () => {
|
||||
const files = ['/first', '/second', '/third'];
|
||||
expect(intoChunks(2, files)).toEqual([['/first', '/second'], ['/third']]);
|
||||
expect(intoChunks(1, 2, files)).toEqual([
|
||||
['/first', '/second'],
|
||||
['/third'],
|
||||
]);
|
||||
});
|
||||
|
||||
it('should split chunks correctly more chunks than items', () => {
|
||||
const files = ['/first', '/second', '/third'];
|
||||
expect(intoChunks(5, files)).toEqual([['/first'], ['/second'], ['/third']]);
|
||||
expect(intoChunks(1, 5, files)).toEqual([
|
||||
['/first'],
|
||||
['/second'],
|
||||
['/third'],
|
||||
]);
|
||||
});
|
||||
|
||||
it('should split chunks correctly equal chunks with items', () => {
|
||||
const files = ['/first', '/second', '/third'];
|
||||
expect(intoChunks(3, files)).toEqual([['/first'], ['/second'], ['/third']]);
|
||||
expect(intoChunks(1, 3, files)).toEqual([
|
||||
['/first'],
|
||||
['/second'],
|
||||
['/third'],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user