jest-localstorage-mock - A module to mock window.localStorage and window.sessionStorage in Jest

  •        325

Use this module with Jest to run web tests that rely on localstorage and / or sessionStorage where you want a working localStorage API with mocked functions. This module has no runtime dependencies so your project won't pull in additional module dependencies by using this.

https://github.com/clarkbw/jest-localstorage-mock

Tags
Implementation
License
Platform

   




Related Projects

react-native-storage - local storage wrapper for both react-native and browser

  •    Javascript

This is a local storage wrapper for both react-native(AsyncStorage) and browser(localStorage). ES6 syntax, promise for async load, fully tested with jest. You don't have to configure anything(but require react native version >= 0.13).

majestic - ⚡ Zero config UI for Jest

  •    TypeScript

Majestic is an electron app that provides a UI for running tests with Jest. Jest CLI itself provides one of the best testing experiences available today. But Majestic humbly tries to expand upon it by providing a rich UI to be used during the dev/test loop.Ok, I lied partially about the zero config part.

jest-image-snapshot - Jest matcher for image comparisons

  •    Javascript

Jest matcher that performs image comparisons using pixelmatch and behaves just like Jest snapshots do! Very useful for visual regression testing. The failure threshold can be set in percent, in this case if the difference is over 1%.

jest-puppeteer - Run your tests using Jest & Puppeteer 🎪✨

  •    Javascript

Gold Sponsors are those who have pledged $100/month and more to jest-puppeteer. Writing integration test can be done using Puppeteer API but it can be complicated and hard because API is not designed for testing.

jest-in-case - Jest utility for creating variations of the same test

  •    Javascript

In your Jest tests, import cases from jest-in-case. Then you can call cases with a title, a tester, and some testCases.


jest-styled-components - Jest utilities for Styled Components

  •    Javascript

A set of utilities for testing Styled Components with Jest. This package improves the snapshot testing experience and provides a brand new matcher to make expectations on the style rules. Jest snapshot testing is an excellent way to test React components (or any serializable value) and make sure things don't change unexpectedly. It works with Styled Components but there are a few problems that this package addresses and solves.

Jasmine-Matchers - A huge library of test matchers for Jasmine and Jest.

  •    Javascript

A huge library of test matchers for a range of common use-cases, compatible with all versions of Jasmine and Jest. Custom Matchers make tests easier to read and produce relevant and useful messages when they fail.

Jest - Delightful JavaScript Testing.

  •    Javascript

Jest is a delightful JavaScript Testing Framework with a focus on simplicity. It works with projects using: Babel, TypeScript, Node, React, Angular, Vue and more. It provides instant feedback, fast interactive watch mode runs only test files related to changed files and is optimized to give signal quickly.

snapshot-diff - Diffing snapshot utility for Jest

  •    Javascript

Diffing snapshot utility for Jest. Takes two values, and return their difference as a string, ready to be snapshotted with toMatchSnapshot(). Especially helpful when testing the difference between different React component states.

jest-extended - Additional Jest matchers 🃏💪

  •    Javascript

Jest is an amazing test runner and has some awesome assertion APIs built in by default. However there are times when having more specific matchers (assertions) would be far more convenient. If you've come here to help contribute - Thanks! Take a look at the contributing docs as a way of getting started.

babel-plugin-webpack-loaders - babel 6 plugin which allows to use webpack loaders

  •    Javascript

Since plugin was published, there were a lot of changes in testing software. Be sure in most(all) cases you DON'T need this plugin for testing. I highly recommend you to use jest for testing, and use moduleNameMapper (identity-obj-proxy, etc) to mock CSS-Modules and other webpack loaders. This Babel 6 plugin allows you to use webpack loaders in Babel. It's now easy to run universal apps on the server without additional build steps, to create libraries as usual with babel src --out-dir lib command, to run tests without mocking-prebuilding source code. It just replaces require - import statements with webpack loaders results. Take a look at this Babel build output diff to get the idea.

jest-cheat-sheet - Jest cheat sheet

  •    

I recommend Mrm and jest-codemods for single-command Jest installation and easy migration from other frameworks. See more examples in Jest docs.

vue-jest - Jest Vue transformer

  •    Javascript

To define vue-jest as a transformer for your .vue files, you need to map .vue files to the vue-jest module. A full config will look like this.

expect-jsx - ✅ toEqualJSX for expect assertion library

  •    Javascript

Note from maintainers Since Jest supports snapshot testing, we recommend you to use that instead of expect-jsx. expect-jsx is no more compatible with recent Jest versions (22), it can be made compatible so feel free to open a PR if so.

store - A better way to use localStorage and sessionStorage

  •    Javascript

A feature-filled and friendly way to take advantage of localStorage and sessionStorage (JSON, namespacing, extensions, etc). Passing in false for the optional overwrite parameters will cause set actions to be skipped if the storage already has a value for that key. All set action methods return the previous value for that key, by default. If overwrite is false and there is a previous value, the unused new value will be returned.

jest-preset-angular - Jest configuration preset for Angular projects.

  •    TypeScript

A preset of Jest configuration for Angular projects. This is a part of the article: Testing Angular faster with Jest.

localStorageDB - A simple database layer for localStorage and sessionStorage for creating structured data in the form of databases and tables

  •    Javascript

localStorageDB is a simple layer over localStorage (and sessionStorage) that provides a set of functions to store structured data like databases and tables. It provides basic insert/update/delete/query capabilities. localStorageDB has no dependencies, and is not based on WebSQL. Underneath it all, the structured data is stored as serialized JSON in localStorage or sessionStorage. Browsers need to support "Local Storage" in order to make localeStorageDB working.

enzyme - JavaScript Testing utilities for React

  •    Javascript

Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.Enzyme's API is meant to be intuitive and flexible by mimicking jQuery's API for DOM manipulation and traversal.