Security News
OpenJS: “XZ Utils Cyberattack Likely Not an Isolated Incident”
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
snapsnap
Advanced tools
Weekly downloads
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 120 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.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
Company News
Come meet the Socket team at BSidesSF and RSA! We're sponsoring several fun networking events and we would love to see you there.
Security News
OSI is starting a conversation aimed at removing the excuse of the SaaS loophole for companies navigating licensing and the complexities of doing business with open source.