Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript definitions #46

Open
jovanmilenkoski opened this issue Sep 28, 2018 · 4 comments
Open

TypeScript definitions #46

jovanmilenkoski opened this issue Sep 28, 2018 · 4 comments

Comments

@jovanmilenkoski
Copy link

Really nice helper, using this in my project a lot. But should I expect TypeScript definitions anytime soon?

@ivank
Copy link

ivank commented Oct 2, 2018

I stumbled on this package too and missed not having types for it. Opened a PR on DefinitelyTyped about it which just got merged, it should be in the npmjs registry in a couple of hours.

@HajoAhoMantila
Copy link

@ivank : awesome, thanks!

@moikot
Copy link

moikot commented Apr 5, 2019

Is there any way to add noVersionCheck ?

@chiubaca
Copy link

@ivank I'm having a bad time with "@types/lambda-tester": "^3.6.0"

My tests keep failing with "error TS7006: Parameter 'result' implicitly has an 'any' type." I have no idea how to make this error go away. I hope you can help?

Here's what my simple unit test looks like (I'm using Jest):

 test("Access via GET is not allowed", async () => {
   await LambdaTester(handler)
     .event({ httpMethod: "GET" } as APIGatewayProxyEvent)
     .expectResult((result) => {
       return expect(result).toEqual({
         body: '{"error":"POST requests only"}',
         headers: {
           "Content-Type": "application/json"
         },
         statusCode: 405
       });
     });
 });

My workaround it to uninstall @types/lambda-tester and create blank declaration file with declare module "lambda-tester"; inside it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants