mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
[tests] Add cross platform chunked testing and leverage turbo more (#7795)
* [tests] Use `turbo` for unit tests * . * . * Revert "." This reverts commit 3d6204fef3fda3c7b4bf08955a186fe806d7c597. * Add "src/util/constants.ts" to outputs * . * Add `@vercel/node-bridge` outputs * . * Mac and Windows * . * Node 14 * . * . * Add templates to CLI output * Run only selected test files * Add cross platform testing * make test paths relative and have minimum per chunk * add install arg * update shell * bump cache key * use backslashes on windows * pass tests as arg * update script name * update turbo config * forward turbo args correctly * dont use backslashes * chunk integration tests instead * update env * separate static-build tests * ensure unit test turbo cache is saved * ensure turbo cache is saved for dev/cli * fix cache key and update timeout * Increase static-build unit test timeout * Leverage turbo remote caching instead of actions/cache * apply suggestions and test chunking itself * update other ci jobs * fix test collecting Co-authored-by: Nathan Rajlich <n@n8.io>
This commit is contained in:
18
utils/chunk-tests.test.js
vendored
Normal file
18
utils/chunk-tests.test.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
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']]);
|
||||
});
|
||||
|
||||
it('should split chunks correctly more chunks than items', () => {
|
||||
const files = ['/first', '/second', '/third'];
|
||||
expect(intoChunks(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']]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user