mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 21:07:46 +00:00
When an instance of this class is returned in a Builder's `output`, it is a signal to the build system that it needs to add additional files to the final Lambda before creating the zip file.
22 lines
733 B
TypeScript
Vendored
22 lines
733 B
TypeScript
Vendored
import { NodejsLambda, FileBlob } from '../src';
|
|
|
|
describe('Test `NodejsLambda`', () => {
|
|
it('should create an instance', () => {
|
|
const helloSrc = 'module.exports = (req, res) => res.end("hi");';
|
|
const lambda = new NodejsLambda({
|
|
files: {
|
|
'api/hello.js': new FileBlob({ data: helloSrc }),
|
|
},
|
|
handler: 'api/hello.js',
|
|
runtime: 'node14.x',
|
|
shouldAddHelpers: true,
|
|
shouldAddSourcemapSupport: false,
|
|
});
|
|
expect(lambda.handler).toEqual('api/hello.js');
|
|
expect(lambda.runtime).toEqual('node14.x');
|
|
expect(lambda.shouldAddHelpers).toEqual(true);
|
|
expect(lambda.shouldAddSourcemapSupport).toEqual(false);
|
|
expect(lambda.awsLambdaHandler).toBeUndefined();
|
|
});
|
|
});
|