All Projects → ikatyang → jest-playback

ikatyang / jest-playback

Licence: MIT license
Record and playback http requests from your Jest tests

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jest-playback

Softest
Recording Browser Interactions And Generating Test Scripts.
Stars: ✭ 208 (+307.84%)
Mutual labels:  playback, record
Selenium Ide
Open Source record and playback test automation for the web.
Stars: ✭ 1,815 (+3458.82%)
Mutual labels:  playback, record
softest
Recording Browser Interactions And Generating Test Scripts.
Stars: ✭ 225 (+341.18%)
Mutual labels:  playback, record
dart vlc
🎞 Flutter audio / video playback, broadcast & recording library for Windows & Linux.
Stars: ✭ 439 (+760.78%)
Mutual labels:  playback, record
request-on-steroids
An HTTP client ✨ with retry, circuit-breaker and tor support 📦 out-of-the-box
Stars: ✭ 19 (-62.75%)
Mutual labels:  request
Blog
h2O's Blog
Stars: ✭ 18 (-64.71%)
Mutual labels:  record
Apollo
Apollo is a Open-Source music player for playback and organization of audio files on Microsoft Windows, built using Python.
Stars: ✭ 13 (-74.51%)
Mutual labels:  playback
chronosjs
JS Channels (Events / Commands / Reqest-Response / Courier) Mechanism
Stars: ✭ 35 (-31.37%)
Mutual labels:  request
nestjs-cls
A continuation-local storage (async context) module compatible with NestJS's dependency injection.
Stars: ✭ 110 (+115.69%)
Mutual labels:  request
shaka-player-react
A simple React component wrapper for shaka-player
Stars: ✭ 79 (+54.9%)
Mutual labels:  playback
RecordWaveView
a beatiful wave animation for recording ,support android Mp3 record
Stars: ✭ 62 (+21.57%)
Mutual labels:  record
hent
A small utility to fetch remote files into buffers
Stars: ✭ 23 (-54.9%)
Mutual labels:  request
oh-my-request
🔮 simple request library by java8
Stars: ✭ 41 (-19.61%)
Mutual labels:  request
http-method
🍇 Provides constants for HTTP request methods.
Stars: ✭ 83 (+62.75%)
Mutual labels:  request
tiny-qiniu-request
tiny-qiniu for rc-upload or antd upload component `customRequest` property
Stars: ✭ 13 (-74.51%)
Mutual labels:  request
api.video-player-sdk
SDK to control and interact with the api.video HTML5 Player
Stars: ✭ 31 (-39.22%)
Mutual labels:  playback
get-it
Composable HTTP request library for node and browsers
Stars: ✭ 19 (-62.75%)
Mutual labels:  request
httper
An asynchronous HTTP(S) client built on top of hyper.
Stars: ✭ 16 (-68.63%)
Mutual labels:  request
node-match-path
Matches a URL against a path. Parameters, wildcards, RegExp.
Stars: ✭ 30 (-41.18%)
Mutual labels:  request
BookingScraper
🌎 🏨 Scrape Booking.com 🏨 🌎
Stars: ✭ 68 (+33.33%)
Mutual labels:  request

jest-playback

npm build

Record and playback http requests from your Jest tests

Changelog

Install

# using npm
npm install --save-dev jest-playback jest

# using yarn
yarn add --dev jest-playback jest

Usage

// 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

Modes

  • run (default)

    • play records
    • enable net connet
  • play

    • play records
    • disable net connet
  • record

    • enable net connect
    • record all requests
  • real

    • enable net connect

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

Related

  • nock: HTTP mocking and expectations library
  • ava-playback: Record and playback http requests from your ava tests

License

MIT © Ika

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].