5.6.11 • Published 15 days ago
@mvf/servicer v5.6.11
Servicer package
Usage
To install the package
Run npm install @mvf/servicer
Contributing
Setup
- Run
make
to build the container - Run
make shell
to enter the container - Run
npm install
to install dependencies
Refer to package.json for commands
After merging
After you have merged a PR to master, you need to rebuild and publish your changes.
- Checkout master
git checkout master && git pull
- Use one of the following make publish commands to publish changes:
make publish kind=patch
- Use this if your change is a bug fix and is backwards compatible.make publish kind=minor
- Use this if your change adds new functionality and is backwards compatible.make publish kind=major
- Use this if your change is not backwards compatible.
Setup Tests
- In RestEvents, CommandEvents or BackendEvents, add import
bindSimulator
:import { bindSimulator } from '@mvf/servicer';
- Then use
bindSimulator
to create asimulate
function:export const simulate = bindSimulator(RestEvents);
- In the tests it is then possible to call actions using the simulate function:
const result = await simulate(ActionConstant, { headers }, { body });
Success response
const result = await simulate(ActionConstant, { headers }, { body });
result.output.output; // will contain response from Action
Error response
Response with Status code & Error message
const err = await catchAsyncError(async () => {
await simulate(ActionConstant,{headers},{body});
});
expect(err.status).toBe(400);
expect(err.message).toBe('Error message');
Response with type of error
await expect(simulate(ActionConstant, {headers}, {body})).rejects.toThrow(BadRequestError);
5.6.11
15 days ago
5.6.10
16 days ago
5.6.9
21 days ago
5.6.8
21 days ago
5.6.7
21 days ago
5.6.6
21 days ago
5.6.5
21 days ago
5.6.4
21 days ago
5.6.3
21 days ago
5.6.2
21 days ago
5.6.1
21 days ago
5.6.0
21 days ago
5.5.0
1 year ago
5.4.0
1 year ago
5.3.1
2 years ago
5.3.0
2 years ago
5.0.3
2 years ago
5.2.0
2 years ago
5.0.2
2 years ago
5.1.0
2 years ago
5.0.1
2 years ago
5.0.0
2 years ago
4.0.2
2 years ago
4.0.0
4 years ago
3.1.0
4 years ago
3.0.0
4 years ago
2.2.16
4 years ago
2.2.15
4 years ago
2.2.13
4 years ago
2.2.14
4 years ago
2.2.12
4 years ago
2.2.11
4 years ago
2.2.10
4 years ago
2.2.7
4 years ago
2.2.6
4 years ago
2.2.1
4 years ago
2.2.3
4 years ago
2.2.2
4 years ago
2.2.5
4 years ago
2.2.4
4 years ago
2.1.2
4 years ago
2.2.0
4 years ago
2.1.3
4 years ago
2.1.1
4 years ago
2.1.0
4 years ago
2.0.0
4 years ago
1.3.0
4 years ago
1.2.0
4 years ago
1.0.0
4 years ago