Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
cdk-lambda-nodejs-mock
Advanced tools
Readme
The CDK NodejsFunction construct uses Parcel and Docker to conveniently bundle up your lambda modules. However this is a slow and processor-intensive operation, which results in very slow testing with e.g. Jest.
This module mocks out NodeJsFunctions by replacing them with a standard CDK Lambda Function for the purpose of testing only.
We recommend using this module across your entire CDK project, by editing your Jest config (e.g. in package.json) to add the following:
{
"moduleNameMapper": {
"@aws-cdk/aws-lambda-nodejs": "cdk-lambda-nodejs-mock"
}
}
You can use in a specific test file only, rather than globally, as follows:
jest.mock('@aws-cdk/aws-lambda-nodejs', () =>
require('cdk-lambda-nodejs-mock')
);
Note we use require rather than import, as jest.mock
is hoisted above import.
The module uses peerDependencies rather than dependencies, so that it uses exactly the same CDK version as in your project. This means that you don't need to do anything to make it work with whichever cdk version you are using.
CD Feature | Provided |
---|---|
✅ | Typescript |
✅ | Linting (AirBnB + Prettier) |
✅ | Unit tests (Jest) |
✅ | Coverage check (ideally 100% with Jest) |
✅ | Github Continuous Deployment |
This module is contributed by the team at Skyhook
FAQs
Mock out NodeJsFunction's processor-intensive calls to Parcel/Docker
The npm package cdk-lambda-nodejs-mock receives a total of 835 weekly downloads. As such, cdk-lambda-nodejs-mock popularity was classified as not popular.
We found that cdk-lambda-nodejs-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.