GithubHelp home page GithubHelp logo

jest-community / awesome-jest Goto Github PK

View Code? Open in Web Editor NEW
1.4K 20.0 118.0 948 KB

🕶Awesome Jest packages and resources

Home Page: https://facebook.github.io/jest/

License: MIT License

awesome awesome-list jest javascript

awesome-jest's Introduction

Awesome Jest Awesome

An awesome list of Jest packages and resources

Contents

Packages

Matchers

IDE

  • vscode-jest Works out of the box Jest based testing in VS Code.
  • vscode-jest-runner Simple way to run or debug one or more tests from context menu, codelens or command plalette.
  • wallaby The pinnacle of the idea of a test runner integrated into an editor.
  • coc-jest Jest plugin for coc.nvim.
  • jester A Neovim plugin to easily run and debug Jest tests.

Linting

Runners

Reporters

Results Processors

Environments

Coverage

  • jest-it-up Automatically bump up global thresholds whenever coverage goes above them.
  • jest-coverage-thresholds-bumper Similar to jest-it-up, but allows to specify where coverage summary is located, supports Jest config in JSON files and package.json.
  • jest-a-coverage-slip-detector Designed for parallelized CI, prevents test coverage from slipping. Features include per-file ratcheting, automatic coverage merging, and custom messages.

Snapshot

  • snapshot-diff 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-snapshots-svg Take a React component tree, and render it into an SVG.
  • jest-image-snapshot Take a snapshot test of an image buffer, and catch when the image changes over a threshold. Commonly used for visual regression testing.
  • enzyme-to-json Convert Enzyme wrappers to a format compatible with Jest snapshot testing.
  • jest-styled-components A set of utilities for testing Styled Components with Jest.
  • jest-img-snapshot Image snapshot comparison using pixelmatch with all Jest's snapshot goodies out of the box.
  • jest-file-snapshot Write snapshots to a separate file instead of the default snapshot file used by Jest.
  • Differencify Visual regression testing tool using Jest and Puppeteer to do Image snapshot comparison.
  • StoryShots StoryShots adds automatic Jest Snapshot Testing for Storybook.
  • jest-large-snapshot-warning Add warnings to large snapshots.
  • jest-serializer-react-helmet Include React Helmet data in component snapshots.
  • jest-serializer-json-ld-script Serializes JSON+LD elements as JavaScript objects.
  • @emotion/jest Include Emotion styles in component snapshots.
  • jest-serializer-xml Format XML documents to better visualize in Snapshots.
  • 1log Extensible logger that allows capturing log messages as snapshots.
  • jest-serializer-ansi-escapes Snapshot serializer for ANSI escape sequences.

Migration

  • jest-codemods Makes it easy to migrate from other test runner and frameworks to Jest.
  • @putout/plugin-jest 🐊Putout plugin helps to migrate to latest Jest API.

Library extensions

  • testdouble-jest Support for testdouble.js for users of Jest.
  • jest-puppe-shots A Jest plugin for creating screenshots of React components with a little help of Puppeteer.
  • babel-jest-assertions Babel plugin that automatically adds the number of assertions found in each test with expect.assertions(n) and expect.hasAssertions().
  • typescript-snapshots-plugin Extends the TypeScript dev server to support hovering and jumping to a snapshot.
  • jest-chain Chain Jest matchers together to create one powerful assertion.
  • jest-expect-message Add custom message to Jest expects.
  • @bigtest/interactor A testing and assertion library that makes it easy to test UIs at scale while keeping accessibility at the core.
  • @testdeck/jest Decorator based wrapper around Jest for object oriented testing. Checkout the documentation and a working seed for you to start with.
  • jest-plugin-must-assert A Jest plugin for strict runtime checks. Fails any tests without assertions and prevents async tasks (Promises & timeouts) from leaking across tests.
  • wait-for-expect A await/async function to wait a expect. Useful on e2e test.
  • jest-os-detection Dynamically enable or skip tests based on the OS they run on so you can share the same test suite across various platforms.
  • @fast-check/jest Bring property based testing (aka fuzzing) into Jest.
  • jest-fail-on-console Utility to fail a test when console.error() (or any other method of the console) gets called.

Mocks

Watch plugins

Processor

Presets

Generators

  • jest-test-gen CLI tool to generate a test file with test scaffold for every class method or function exported.
  • text2jest A web-based tool to instantly convert a nested list of plain text test names into a Jest file.

Debug

Resources

Contribute

Contributions welcome! Read the contribution guidelines.

License

MIT

awesome-jest's People

Contributors

alexeyraspopov avatar antonchaukin avatar barakplasma avatar blankll avatar chrisgalvan avatar dangreenisrael avatar dkelosky avatar dubzzz avatar hustcc avatar jodonnell avatar keplersj avatar macku avatar magicmark avatar marchaos avatar matteoh2o1999 avatar mattphillips avatar mitchellcarroll avatar mrazauskas avatar neizan93 avatar nimasoroush avatar nirga avatar orta avatar raingerber avatar rbardini avatar rickhanlonii avatar rogeliog avatar rwalle61 avatar simenb avatar theoutlander avatar unional avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-jest's Issues

jest test ts mocking

can please anyone explain me how to test the four bold lines ? i really don't know i just wrote this test:

jest.mock('../middleware/i18n');
const mockedFunction = changeLanguage as jest.MockedFunction

describe("i18n", () => {
test("language is set to en", async () => {
var i18n = new I18n();
i18n.setLocale("en");
changeLanguage(i18n);
logger.info(mockedFunction);
expect(mockedFunction).toBeCalledTimes(1);
expect(mockedFunction).toBeCalledWith(i18n);
});
});

buuut, it only covers the first two lines of the following code.

export function changeLanguage(i18n: I18n) {
return (req, res, next) => {
const locale = ((req.query.locale as string) || "de-AT").split("-")[0];
req.setLocale(locale.split("-")[0]);
res.locals.lang = i18n.getLocale(req)
next();
};
}

i hope anybody could help me. Pleaseee. Thank you. :)

File lines test tracking coverage

I can see jest cover lines on defined scope i.e. functions and classes. However, oftentimes it does not provide a file line test track. Do I miss or misunderstand something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.