5.2.0 • Published 4 months ago

@lifeomic/test-tool-mockserver v5.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@lifeomic/test-tool-mockserver

npm Build Status

MockServer Client

Some mockserver-client helpers.

import {
  mockInvocation,
  verifyInvocation,
} from '@lifeomic/test-tool-mockserver';

mockInvocation

Mocks the AWS Lambda service level calls. Very useful when combined with localstack invoking lambdas. The service level interactions are handled by the method call, and the consumer provides the lambda invocation request/response payload.

const functionName = 'my-function-name';
const expectedResponse = { verifyResponse: 'result' };
const expectedRequestBody = { verifyRequest: 'value' };
await mockInvocation(mockServerClient, functionName, expectedResponse, expectedRequestBody);
// Invoke so that we can retest verify after invocation
await lambdaV2.invoke({
  FunctionName: functionName,
  Payload: JSON.stringify(expectedRequestBody),
}).promise();

verifyInvocation

Verify that the lambda mock service was invoked with the expected body.

// Verifying one invocation should succeed now
await verifyInvocation(mockServerClient, functionName, expectedRequestBody, 1);
5.2.0

4 months ago

5.1.1

4 months ago

5.1.0

8 months ago

5.0.0

8 months ago

4.1.3

11 months ago

4.1.2

1 year ago

4.1.1

1 year ago

4.1.0

1 year ago

3.3.1

2 years ago

4.0.0

2 years ago

3.3.0

2 years ago