[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:
Steven
2023-03-07 18:50:21 -05:00
committed by GitHub
parent f20756344e
commit c06209901c
4 changed files with 43 additions and 25 deletions

View File

@@ -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'],
]);
});
});