mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 21:07:46 +00:00
Add optional experimentalStreamingLambda field for prerender (#10476)
This adds a new `experimentalStreamingLambda` field to Prerender outputs, allowing references to an optional streaming lambda path.
This commit is contained in:
36
packages/build-utils/test/unit.test.ts
vendored
36
packages/build-utils/test/unit.test.ts
vendored
@@ -387,6 +387,42 @@ it('should support passQuery correctly', async () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should support experimentalStreamingLambdaPath correctly', async () => {
|
||||
new Prerender({
|
||||
expiration: 1,
|
||||
fallback: null,
|
||||
group: 1,
|
||||
bypassToken: 'some-long-bypass-token-to-make-it-work',
|
||||
experimentalStreamingLambdaPath: undefined,
|
||||
});
|
||||
new Prerender({
|
||||
expiration: 1,
|
||||
fallback: null,
|
||||
group: 1,
|
||||
bypassToken: 'some-long-bypass-token-to-make-it-work',
|
||||
experimentalStreamingLambdaPath: '/some/path/to/lambda',
|
||||
});
|
||||
new Prerender({
|
||||
expiration: 1,
|
||||
fallback: null,
|
||||
group: 1,
|
||||
bypassToken: 'some-long-bypass-token-to-make-it-work',
|
||||
});
|
||||
|
||||
expect(() => {
|
||||
new Prerender({
|
||||
expiration: 1,
|
||||
fallback: null,
|
||||
group: 1,
|
||||
bypassToken: 'some-long-bypass-token-to-make-it-work',
|
||||
// @ts-expect-error testing invalid field
|
||||
experimentalStreamingLambdaPath: 1,
|
||||
});
|
||||
}).toThrowError(
|
||||
`The \`experimentalStreamingLambdaPath\` argument for \`Prerender\` must be a string.`
|
||||
);
|
||||
});
|
||||
|
||||
it('should support require by path for legacy builders', () => {
|
||||
const index = require('../');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user