DefinitelyTyped/aws-serverless-express/aws-serverless-express-tests.ts
Mohamed Hegazy 6d0b399f51 Fix for https://github.com/Microsoft/TypeScript/issues/11916 (#12425)
* Switch express-serve-static-core to a module

* Add tsconfig to aws-serverless-express

* Switch aws-serverless-express to module

* Fix dangling pointer

* Fix wrong file name

* Add tsconfig.json

* switch seamless-immutable a module

* Add tsconfig.json

* use --strictNullChecks
2016-11-02 18:54:15 -07:00

29 lines
728 B
TypeScript

/// <reference types="express"/>
import * as awsServerlessExpress from 'aws-serverless-express';
import * as express from 'express';
const app = express();
const server = awsServerlessExpress.createServer(app, () => {});
const mockEvent = {
key: 'value'
};
const mockContext = {
callbackWaitsForEmptyEventLoop: true,
functionName: 'testFunction',
functionVersion: '1',
invokedFunctionArn: 'arn',
memoryLimitInMB: 128,
awsRequestId: 'id',
logGroupName: 'group',
logStreamName: 'stream',
getRemainingTimeInMillis: () => 2000,
done: () => false,
fail: (error: any) => false,
succeed: (message: string) => false
};
awsServerlessExpress.proxy(server, mockEvent, mockContext);