
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
jest-playback
Advanced tools
Record and playback http requests from your Jest tests
# using npm
npm install --save-dev jest-playback jest
# using yarn
yarn add --dev jest-playback jest
// records are stored in `${__dirname}/__playbacks__`.
require("jest-playback").setup(__dirname);
const request = require("request");
test("example", done => {
request('http://www.example.com/', (_err, _res, body) => {
expect(body).toMatchSnapshot();
done();
});
});
You can control which mode to use by specifying the second argument of setup
:
require("jest-playback").setup(__dirname, "record");
or via the JEST_PLAYBACK_MODE
environment variable:
JEST_PLAYBACK_MODE=record npx jest
run
(default)
play
record
real
# lint
yarn run lint
# build
yarn run build
# test
yarn run test
MIT © Ika
FAQs
Record and playback HTTP requests from your Jest tests
The npm package jest-playback receives a total of 1,700 weekly downloads. As such, jest-playback popularity was classified as popular.
We found that jest-playback 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.