Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
snapsnap
Advanced tools
Readme
Capture, cache, and replay HTTP queries in your tests using Nock.
__http__/
.__http__/
and used instead of real queries.Snapsnap behaves similarly to Jest Snapshots. If an HTTP query has not been snapshotted, a real HTTP query will be made. Otherwise, a cached version of the query will be returned.
To signal that a test should be snapshotted, simply use it.snap()
instead of it()
. The framework will manage the rest.
it.snap(
'should query the API',
async () => {
const result = await request('https://postman-echo.com/get?foo1=bar1&foo2=bar2');
const json = await result.json();
expect(json).toMatchSnapshot();
}
);
Supports Jest with Circus (=default) test runner.
Snapsnap is implemented as a test environment that extends Jest's built-in NodeEnvironment
.
// ./jest.config.js
module.exports = {
testEnvironment: 'snapsnap/jest-env.js'
};
Based on Jest Nock Back and Jest Nock.
FAQs
Tools for snapshotting, replaying, and mocking HTTP queries with Jest
The npm package snapsnap receives a total of 197 weekly downloads. As such, snapsnap popularity was classified as not popular.
We found that snapsnap 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
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.