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

Support for callbackWaitsForEmptyEventLoop = false #72

Open
lingolex opened this issue Aug 27, 2021 · 0 comments
Open

Support for callbackWaitsForEmptyEventLoop = false #72

lingolex opened this issue Aug 27, 2021 · 0 comments

Comments

@lingolex
Copy link

lingolex commented Aug 27, 2021

Hello,

We're running into issues with our following lambda:

module.exports.handle = (event, lambdaContext, callback) => {
  lambdaContext.callbackWaitsForEmptyEventLoop = false;
  /* lambda body */
};

We're trying to test it like so:

  it('should return a 500 response if there is an HTTP error', (done) => {
    LambdaTester(handle)
      .event(defaultEvent)
      .expectResult((result) => {
        / * validations */
      })
      .verify(done);
  });

But we're getting the following error:

Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

I saw in this issue that using callbackWaitsForEmptyEventLoop = false is no supported, but we have use case for it (we have a constant that polls a configuration every 10 seconds so the user invocation does not have to wait for that) and would like to see if there's another way we can run the test. Is there some option for us to use lambda-tester with this code?

Thanks in advance!

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

No branches or pull requests

1 participant