Delightful JavaScript Testing.

Overview

npm version Jest is released under the MIT license. Follow on Twitter

 

🃏 Delightful JavaScript Testing

👩🏻‍💻 Developer Ready: A comprehensive JavaScript testing solution. Works out of the box for most JavaScript projects.

🏃🏽 Instant Feedback: Fast, interactive watch mode only runs test files related to changed files.

📸 Snapshot Testing: Capture snapshots of large objects to simplify testing and to analyze how they change over time.

See more on jestjs.io

Table of Contents

Getting Started

Install Jest using yarn:

yarn add --dev jest

Or npm:

npm install --save-dev jest

Note: Jest documentation uses yarn commands, but npm will also work. You can compare yarn and npm commands in the yarn docs, here.

Let's get started by writing a test for a hypothetical function that adds two numbers. First, create a sum.js file:

function sum(a, b) {
  return a + b;
}
module.exports = sum;

Then, create a file named sum.test.js. This will contain our actual test:

const sum = require('./sum');

test('adds 1 + 2 to equal 3', () => {
  expect(sum(1, 2)).toBe(3);
});

Add the following section to your package.json:

{
  "scripts": {
    "test": "jest"
  }
}

Finally, run yarn test or npm run test and Jest will print this message:

PASS  ./sum.test.js
✓ adds 1 + 2 to equal 3 (5ms)

You just successfully wrote your first test using Jest!

This test used expect and toBe to test that two values were exactly identical. To learn about the other things that Jest can test, see Using Matchers.

Running from command line

You can run Jest directly from the CLI (if it's globally available in your PATH, e.g. by yarn global add jest or npm install jest --global) with a variety of useful options.

Here's how to run Jest on files matching my-test, using config.json as a configuration file and display a native OS notification after the run:

jest my-test --notify --config=config.json

If you'd like to learn more about running jest through the command line, take a look at the Jest CLI Options page.

Additional Configuration

Generate a basic configuration file

Based on your project, Jest will ask you a few questions and will create a basic configuration file with a short description for each option:

jest --init

Using Babel

To use Babel, install required dependencies via yarn:

yarn add --dev babel-jest @babel/core @babel/preset-env

Configure Babel to target your current version of Node by creating a babel.config.js file in the root of your project:

// babel.config.js
module.exports = {
  presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
};

The ideal configuration for Babel will depend on your project. See Babel's docs for more details.

Making your Babel config jest-aware

Jest will set process.env.NODE_ENV to 'test' if it's not set to something else. You can use that in your configuration to conditionally setup only the compilation needed for Jest, e.g.

// babel.config.js
module.exports = api => {
  const isTest = api.env('test');
  // You can use isTest to determine what presets and plugins to use.

  return {
    // ...
  };
};

Note: babel-jest is automatically installed when installing Jest and will automatically transform files if a babel configuration exists in your project. To avoid this behavior, you can explicitly reset the transform configuration option:

// jest.config.js
module.exports = {
  transform: {},
};

Using webpack

Jest can be used in projects that use webpack to manage assets, styles, and compilation. webpack does offer some unique challenges over other tools. Refer to the webpack guide to get started.

Using parcel

Jest can be used in projects that use parcel-bundler to manage assets, styles, and compilation similar to webpack. Parcel requires zero configuration. Refer to the official docs to get started.

Using TypeScript

Jest supports TypeScript, via Babel. First, make sure you followed the instructions on using Babel above. Next, install the @babel/preset-typescript via yarn:

yarn add --dev @babel/preset-typescript

Then add @babel/preset-typescript to the list of presets in your babel.config.js.

// babel.config.js
module.exports = {
  presets: [
    ['@babel/preset-env', {targets: {node: 'current'}}],
+    '@babel/preset-typescript',
  ],
};

However, there are some caveats to using TypeScript with Babel. Because TypeScript support in Babel is purely transpilation, Jest will not type-check your tests as they are run. If you want that, you can use ts-jest instead, or just run the TypeScript compiler tsc separately (or as part of your build process).

Documentation

Learn more about using Jest on the official site!

Badge

Show the world you're using Jest tested with jest jest

[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)

Contributing

Development of Jest happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Jest.

Code of Conduct

Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Jest.

Good First Issues

To help you get your feet wet and get you familiar with our contribution process, we have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started.

Credits

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers! 🙏

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

License

Jest is MIT licensed.

Comments
  • console.log does not output when running tests

    console.log does not output when running tests

    Do you want to request a feature or report a bug?

    Report a bug.

    What is the current behavior?

    Calling console.log using the default testEnvironment of jsdom doesn't print to stdout.

    If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

    1. Clone https://github.com/udbhav/jest-test
    2. Run yarn test
    3. Confirm that you're not seeing anything from console.log
    4. Change the testEnvironment Jest configuration setting to node
    5. Re-run yarn test
    6. Confirm that you're seeing output from console.log

    What is the expected behavior?

    I would expect to have console.log always output while my tests are running.

    Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

    See package.json and yarn.lock in the repo for package versions. I'm running node 7.3.0 and yarn 0.18.1

    opened by udbhav 243
  • Watch mode stopped working on macOS Sierra

    Watch mode stopped working on macOS Sierra

    This is a bug that seems to happen ever since I've updated to Sierra.

    Whenever I want to run Jest in --watch mode it crashes:

    $ jest --watch
    2016-09-22 10:49 node[79167] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    2016-09-22 10:49 node[79167] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    2016-09-22 10:49 node[79167] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    events.js:160
          throw er; // Unhandled 'error' event
          ^
    
    Error: Error watching file for changes: EMFILE
        at exports._errnoException (util.js:1036:11)
        at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
    

    Tried reinstalling the node modules, checking for any updates and anything. I can't seem to reproduce it on a new project but on the other hand even if I just run an empty test suite with --testPathPattern it still crashes, so I'm guessing it's a dependency conflict somewhere. I don't have any setup files or anything, it's literally running an empty file and crashing.

    I don't get any more output with --debug so not sure what else to provide to help. This does not happen with --watchman

    $ node --version && npm --version && jest --version
    v6.6.0
    3.10.8
    v15.1.1
    
    opened by Anahkiasen 140
  • Jest 24 is slower than Jest 23.6.0 on the same test suite

    Jest 24 is slower than Jest 23.6.0 on the same test suite

    🐛 Bug Report

    Filing bug per #7732 https://github.com/facebook/jest/issues/7732#issuecomment-460676324 Jest v24 takes 38 seconds vs v23 28 seconds to run 50 suites (296 tests).

    To Reproduce

    Steps to reproduce the behavior: Jest v23 setup: .babelrc

    {
      "presets": ["es2015", "react", "stage-3", "env"]
    }
    

    package.json:

    ...
        "babel-core": "6.26.0",
        "babel-jest": "22.4.1",
        "babel-loader": "7.1.2",
        "babel-preset-env": "1.6.1",
        "babel-preset-es2015": "6.24.1",
        "babel-preset-react": "6.24.1",
        "babel-preset-stage-3": "6.24.1",
        "jest": "23.6.0",
    ...
    

    Jest v24 setup: .babelrc

    {
      "presets": ["@babel/preset-env", "@babel/preset-react"],
      "plugins": [
        "@babel/plugin-syntax-dynamic-import",
        "@babel/plugin-syntax-import-meta",
        ["@babel/plugin-proposal-class-properties", { "loose": false },
        "@babel/plugin-proposal-json-strings"
      ]
    }
    

    package.json:

    ...
        "@babel/core": "7.2.2",
        "@babel/plugin-proposal-class-properties": "7.3.0",
        "@babel/plugin-proposal-json-strings": "7.2.0",
        "@babel/plugin-syntax-dynamic-import": "7.2.0",
        "@babel/plugin-syntax-import-meta": "7.2.0",
        "@babel/preset-env": "7.3.1",
        "@babel/preset-react": "7.0.0",
        "jest": "24.1.0",
    ...
    

    Jest config is not changed between v23 and v24:

    module.exports = {
      'verbose': false,
      'coverageThreshold': {
        'global': {
          'branches': 40,
          'functions': 45,
          'lines': 50,
          'statements': 50
        }
      },
      'projects': [
        '<rootDir>/src/test/js/reactapp'
      ],
      'moduleDirectories': [
        'src',
        'node_modules'
      ],
      'testURL': 'http://mockserver:9999',
      'collectCoverage': true,
      'coverageDirectory': '<rootDir>/build/coverage/',
      'coverageReporters': [
        'json',
        'html'
      ]
    };
    

    Expected behavior

    Jest v24 running performance matches v23.

    Link to repl or repo (highly encouraged)

    Not available

    Run npx envinfo --preset jest

    Paste the results here:

    System:
        OS: Windows 7
        CPU: (4) x64 Intel(R) Xeon(R) CPU E5-2695 v4 @ 2.10GHz
      Binaries:
        Node: 8.12.0 - C:\Program Files\nodejs\node.EXE
        npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
    
    Help Wanted :boom: Regression 
    opened by vitalibozhko 139
  • console.log does not emit output

    console.log does not emit output

    Please try out Jest 24 if you're having issues with missing console.log output


    Branching from Issue #2441

    @cpojer I'm not seeing any console.log output with this setup (macOS):

    $ node --version
    v7.4.0
    

    Files

    package.json:

    {
      "dependencies": {
        "@types/jest": "19.2.4",
        "jest": "20.0.4",
        "ts-jest": "20.0.6",
        "typescript": "2.3.4"
      }
    }
    

    __tests__/jestconfig.json:

    {
      "rootDir": "../",
      "globals": {
        "__TS_CONFIG__": {}
          
      },
      "moduleFileExtensions": [
        "ts",
        "tsx",
        "js",
        "jsx",
        "json"
      ],
      "transform": {
        "\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
      },
      "testRegex": "__tests__/.*test_.*\\.(ts|tsx|js)$"
    

    __tests__/test_foo.ts:

    import {} from 'jest';
    
    console.log('CONSOLE before test');
    test('fail', () => {
      console.log('CONSOLE inside test');
      expect(true).toEqual(false);
      console.log('CONSOLE end of test');
    })
    

    __tests__/test_bar.js:

    console.log('BAR CONSOLE before test');
    test('fail', () => {
      console.log('BAR CONSOLE inside test');
      expect(true).toEqual(false);
      console.log('BAR CONSOLE end of test');
    })
    

    Output

    $ jest -c __tests__/jestconfig.json 
     FAIL  __tests__/test_foo.ts
      ● fail
    
        expect(received).toEqual(expected)
        
        Expected value to equal:
          false
        Received:
          true
          
          at Object.<anonymous> (__tests__/test_foo.ts:6:16)
          at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
    
     FAIL  __tests__/test_bar.js
      ● fail
    
        expect(received).toEqual(expected)
        
        Expected value to equal:
          false
        Received:
          true
          
          at Object.<anonymous>.test (__tests__/test_bar.js:4:16)
          at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
    
    Test Suites: 2 failed, 2 total
    Tests:       2 failed, 2 total
    Snapshots:   0 total
    Time:        1.379s
    Ran all test suites.
    

    Single JS test:

    $ jest -c __tests__/jestconfig.json __tests__/test_bar.js 
     FAIL  __tests__/test_bar.js
      ● fail
    
        expect(received).toEqual(expected)
        
        Expected value to equal:
          false
        Received:
          true
          
          at Object.<anonymous>.test (__tests__/test_bar.js:4:16)
          at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
    
      ✕ fail (7ms)
    
    Test Suites: 1 failed, 1 total
    Tests:       1 failed, 1 total
    Snapshots:   0 total
    Time:        0.596s, estimated 1s
    Ran all test suites matching "__tests__/test_bar.js".
    

    Single TS test:

    $ jest -c __tests__/jestconfig.json __tests__/test_foo.ts 
     FAIL  __tests__/test_foo.ts
      ● fail
    
        expect(received).toEqual(expected)
        
        Expected value to equal:
          false
        Received:
          true
          
          at Object.<anonymous> (__tests__/test_foo.ts:6:16)
          at Promise.resolve.then.el (node_modules/p-map/index.js:42:16)
    
      ✕ fail (116ms)
    
    Test Suites: 1 failed, 1 total
    Tests:       1 failed, 1 total
    Snapshots:   0 total
    Time:        1.27s
    Ran all test suites matching "__tests__/test_foo.ts".
    
    Confirmed 
    opened by iffy 138
  • How to mock specific module function?

    How to mock specific module function?

    I'm struggling with something that I think should be both easy and obvious, but for whatever reason I can't figure it out.

    I have a module. It exports multiple functions. Here is myModule.js:

    export function foo() {...}
    export function bar() {...}
    export function baz() {...}
    

    I unmock the module for testing.

    jest.unmock('./myModule.js');

    However, I need to mock foo, because it makes ajax calls to my backend. I want every function in this file to remain unmocked, expect for foo, which I want to be mocked. And the functions bar and baz make calls internally to foo, so when my test calls bar(), the unmocked bar will call the mocked foo.

    It appears in the jest documentation that calls to unmock and mock operate on the entire module. How can I mock a specific function? Arbitrarily breaking up my code into separate modules so they can be tested properly is ridiculous.

    opened by seibelj 123
  • Unexpected Token Import for ES6 modules

    Unexpected Token Import for ES6 modules

    Do you want to request a feature or report a bug? Report a bug

    What is the current behavior? I am using the same testing setup in several projects right now, all from my boilerplate. This problem has popped up in all of them recently, but I haven't yet been able to track it down. It seems that Jest is missing the babel configuration in my package.json and the test suite is failing with 'Unexpected Token Import'. Please keep in mind that up until a week ago, this configuration was working successfully in several projects, so I am assuming it's a regression and figured I should report it.

    Note that when I add a .babelrc file the test suite passes for all but one test, where I get the same Unexpected Token Import, which seems bizarre considering there are a dozen passing tests that all use ES6 imports. Without the .babelrc all 14 tests are failing.

    If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can npm install and npm test.

    It can be reproduced from my boilerplate by installing npm run setup and running npm run test.

    What is the expected behavior? I expect that the Jest configuration that worked previously would still work. It would seem that my preprocessor is no longer running with babel-jest as it was previously.

    Run Jest again with --debug and provide the full configuration it prints. Please mention your node and npm version and operating system.

    jest version = 16.0.2
    test framework = jasmine2
    config = {
      "scriptPreprocessor": "/Users/myMac/Developer/works-in-progress/open-source-maintaining/scalable-react-boilerplate/config/testing/preprocessor.js",
      "moduleFileExtensions": [
        "js",
        "jsx",
        "json"
      ],
      "moduleDirectories": [
        "node_modules",
        "bower_components",
        "shared"
      ],
      "rootDir": "/Users/myMac/Developer/works-in-progress/open-source-maintaining/scalable-react-boilerplate",
      "name": "-Users-myMac-Developer-works-in-progress-open-source-maintaining-scalable-react-boilerplate",
      "setupFiles": [],
      "testRunner": "/Users/myMac/Developer/works-in-progress/open-source-maintaining/scalable-react-boilerplate/node_modules/jest-jasmine2/build/index.js",
      "automock": false,
      "bail": false,
      "browser": false,
      "cacheDirectory": "/var/folders/nq/7kdqy15d3m399326f7wtb_6w0000gn/T/jest",
      "clearMocks": false,
      "coveragePathIgnorePatterns": [
        "/node_modules/"
      ],
      "coverageReporters": [
        "json",
        "text",
        "lcov",
        "clover"
      ],
      "globals": {},
      "haste": {
        "providesModuleNodeModules": []
      },
      "mocksPattern": "__mocks__",
      "moduleNameMapper": {},
      "modulePathIgnorePatterns": [],
      "noStackTrace": false,
      "notify": false,
      "preset": null,
      "preprocessorIgnorePatterns": [
        "/node_modules/"
      ],
      "resetModules": false,
      "testEnvironment": "jest-environment-jsdom",
      "testPathDirs": [
        "/Users/myMac/Developer/works-in-progress/open-source-maintaining/scalable-react-boilerplate"
      ],
      "testPathIgnorePatterns": [
        "/node_modules/"
      ],
      "testRegex": "(/__tests__/.*|\\.(test|spec))\\.jsx?$",
      "testURL": "about:blank",
      "timers": "real",
      "useStderr": false,
      "verbose": null,
      "watch": false,
      "cache": true,
      "watchman": true,
      "testcheckOptions": {
        "times": 100,
        "maxSize": 200
      }
    }
    
    opened by RyanCCollins 97
  • Please consider adding native support for ES modules

    Please consider adding native support for ES modules

    Do you want to request a feature or report a bug? I want to request a feature. What is the current behavior? Right now Jest does not support test suites with import statement. They result in the following error:

    SyntaxError: Unexpected token import
          
          at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
              at Generator.next (<anonymous>)
              at new Promise (<anonymous>)
    

    What is the expected behavior? Would be great if Jest supported ES modules natively.

    Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system. Jest: 21.2.1 node: 8.9.0 npm: 5.5.1

    Before, native support of ES modules was not possible since node.js did not support them. Starting from a few versions ago, node.js added support of ES modules with a flag (https://nodejs.org/api/esm.html). It would be absolutely great if Jest would match this with adding support of ES modules too, probably with a flag or even without it.

    Node.js requires ES modules to have an .mjs extension. In order to support ES modules Jest needs to add a recognition of those extensions. Jest will also need to pass an --experimental-modules flag to node.js until node will implement support of modules without a flag. I'm not sure if any other required changes would be needed within Jest in order to support this. I can only hope it will not be terribly hard.

    Ideally, it would be cool if Jest would recognize modules even in files without .mjs extensions since code that targets browsers do not use them, but I don't know if it is ever possible. Node.js provides loader hooks for that (https://nodejs.org/api/esm.html) but this still doesn't solve the issue with a reliable determination of what type of module the file is.

    I believe ES modules are a great feature vastly superior to all existing JS module solutions. Having it implemented in node.js opens a door for Jest to have it too. This would allow developers stick to using the first truly standardized JS module format not only throughout development, but trough testing as well.

    Discussion ES Modules 
    opened by kirlat 88
  • Support package exports in `jest-resolve`

    Support package exports in `jest-resolve`

    https://nodejs.org/docs/latest-v12.x/api/packages.html#packages_exports

    Hopefully this can be offloaded to resolve. Tracked in https://github.com/browserify/resolve/issues/222

    Help Wanted ES Modules 
    opened by SimenB 86
  • Support for RequireJS

    Support for RequireJS

    If I understand it correctly, there is currently no way of using this with RequireJS rather than CommonJS style require(). Are there any plans of adding support for RequireJS? Is it even feasible?

    opened by eldh 85
  • Unable to change window.location using Object.defineProperty

    Unable to change window.location using Object.defineProperty

    Do you want to request a feature or report a bug? Report a bug

    What is the current behavior?

    Calling the following from inside a test suite:

    Object.defineProperty(location, "hostname", {
      value: "example.com",
      writable: true
    });
    

    throws the following error:

        TypeError: Cannot redefine property: hostname
            at Function.defineProperty (<anonymous>)
    

    What is the expected behavior?

    The code should not throw an exception, and window.location.hostname === "example.com" should evaluate true.

    From the looks of it, jsdom now sets window.location to be unforgeable. The only way to change the values within window.location is to use reconfigure, but (per #2460) Jest doesn't expose jsdom for tests to play around with.

    Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

    Jest version: 22.0.1 Node version: 8.6.0 Yarn version: 1.2.0 OS: macOS High Sierra 10.13.2

    Wontfix Discussion 
    opened by simon360 81
  • Slow React Tests

    Slow React Tests

    Thanks for React and Jest. Loving the combo. Anyhow, I am used to running tests in livereload mode. So anytime a test file is saved, my tests are automatically run. I got this working correctly, but my tests are taking almost 3 seconds to run. That is just with one test file. I am running the files through the preprocessor, so I suspect that is where the problem lies. Do you have any suggestions on how to get the tests to run quickly or any advice on how to speed up the TDD / BDD workflow?

    :rocket: Enhancement 
    opened by TYRONEMICHAEL 81
  • chore(deps): bump react-native from 0.70.3 to 0.70.6

    chore(deps): bump react-native from 0.70.3 to 0.70.6

    Bumps react-native from 0.70.3 to 0.70.6.

    Release notes

    Sourced from react-native's releases.

    0.70.6

    Fixed

    • Fixed regression: @​jest/create-cache-key-function dependency was inadvertedly bumped to 29.x. We are bringing it back to 27.0.1. (fb0e88beb9 by @​kelset)

    Changed

    iOS specific


    You can participate in the conversation on the status of this release in this discussion


    To help you upgrade to this version, you can use the upgrade helper ⚛️


    You can find the whole changelog history in the changelog.md file.

    0.70.5

    Hotfix

    This version is a patch release addressing the Android build issue that has been ongoing since Nov 4th 2022. If you are on 0.70.x, update to this version to fix it.

    If you are on an older version of React Native, refer to this issue for details and the workaround you can apply in your project.


    You can participate in the conversation on the status of this release in this discussion


    To help you upgrade to this version, you can use the upgrade helper ⚛️


    You can find the whole changelog history in the changelog.md file.

    0.70.4

    ... (truncated)

    Changelog

    Sourced from react-native's changelog.

    v0.70.6

    Fixed

    • Fixed regression: @​jest/create-cache-key-function dependency was inadvertedly bumped to 29.x. We are bringing it back to 27.0.1. (fb0e88beb9 by @​kelset)

    Changed

    iOS specific

    v0.70.5

    Fixed

    v0.70.4

    Changed

    Fixed

    iOS specific

    Commits
    • 49dd38f [0.70.6] Bump version numbers
    • fb0e88b [LOCAL] correct fix: bring back jest cache but on the right version
    • c563759 [LOCAL] Bump git checkout cache key
    • 69ce989 Revert "[0.70.6] Bump version numbers"
    • 02a388f [0.70.6] Bump version numbers
    • ef29c9b [LOCAL] remove regression: unwanted @​jest/create-cache-key-function dependency
    • 9bcc5e0 [LOCAL] Bump CLI to 9.3.2
    • 11473c3 Add support Promise.any out of box (#35080)
    • 3f1c55b Update ruby codegen to cleanup build folder. (#34398)
    • 35fa47b [0.70.5] Bump version numbers
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    cla signed dependencies javascript 
    opened by dependabot[bot] 0
  • chore(deps): bump @angular/core from 12.2.17 to 15.0.4

    chore(deps): bump @angular/core from 12.2.17 to 15.0.4

    Bumps @angular/core from 12.2.17 to 15.0.4.

    Release notes

    Sourced from @​angular/core's releases.

    v15.0.4

    15.0.4 (2022-12-14)

    animations

    Commit Description
    fix - 6c1064c72f fix incorrect handling of camel-case css properties (#48436)

    common

    Commit Description
    fix - f30d18a942 Fix TestBed.overrideProvider type to include multi (#48424)
    fix - 59c6bfb632 Update Location to get a normalized URL valid in case a represented URL starts with the substring equals APP_BASE_HREF (#48394)

    compiler-cli

    Commit Description
    fix - b55d2dab5d evaluate const tuple types statically (#48091)

    Special Thanks

    Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, BrowserPerson, Jens, Jessica Janiuk, Joey Perrott, JoostK, Konstantin Kharitonov, Lukas Matta, Piotr Kowalski, Virginia Dooley, Yannick Baron, dario-piotrowicz, lsst25, piyush132000 and why520crazy

    v15.0.3

    15.0.3 (2022-12-07)

    common

    Commit Description
    fix - 50b1c2bf52 Don't generate srcsets with very large sources (#47997)
    fix - bf44dc234a Update Location to support base href containing origin (#48327)

    compiler

    Commit Description
    fix - 9a5d84249a make sure selectors inside container queries are correctly scoped (#48353)

    compiler-cli

    Commit Description
    fix - 167bc0d163 Produce diagnostic rather than crash when using invalid hostDirective (#48314)

    core

    Commit Description
    fix - e4dcaa513e unable to inject ChangeDetectorRef inside host directives (#48355)

    Special Thanks

    Alan Agius, Alex Castle, Andrew Kushnir, Andrew Scott, Bob Watson, Derek Cormier, Joey Perrott, Konstantin Kharitonov, Kristiyan Kostadinov, Paul Gschwendtner, Pawel Kozlowski, dario-piotrowicz and piyush132000

    v15.0.2

    15.0.2 (2022-11-30)

    compiler-cli

    Commit Description
    fix - 86a21f5569 accept inheriting the constructor from a class in a library (#48156)

    Special Thanks

    ... (truncated)

    Changelog

    Sourced from @​angular/core's changelog.

    15.0.4 (2022-12-14)

    animations

    Commit Type Description
    6c1064c72f fix fix incorrect handling of camel-case css properties (#48436)

    common

    Commit Type Description
    f30d18a942 fix Fix TestBed.overrideProvider type to include multi (#48424)

    compiler-cli

    Commit Type Description
    b55d2dab5d fix evaluate const tuple types statically (#48091)

    Special Thanks

    Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, BrowserPerson, Jens, Jessica Janiuk, Joey Perrott, JoostK, Konstantin Kharitonov, Lukas Matta, Piotr Kowalski, Virginia Dooley, Yannick Baron, dario-piotrowicz, lsst25, piyush132000 and why520crazy

    15.1.0-next.2 (2022-12-07)

    common

    Commit Type Description
    8e52ca2714 fix Don't generate srcsets with very large sources (#47997)
    f8ecc194e9 fix Update Location to support base href containing origin (#48327)

    compiler

    Commit Type Description
    4c023956d8 fix make sure selectors inside container queries are correctly scoped (#48353)

    compiler-cli

    Commit Type Description
    27eaded62d fix Produce diagnostic rather than crash when using invalid hostDirective (#48314)

    core

    Commit Type Description
    38421578a2 feat Make the isStandalone() function available in public API (#48114)
    dd42974b07 feat support TypeScript 4.9 (#48005)
    5f9c7ceb90 fix unable to inject ChangeDetectorRef inside host directives (#48355)

    Special Thanks

    Alan Agius, Alex Castle, Andrew Kushnir, Andrew Scott, Bob Watson, Charles Lyding, Derek Cormier, Joey Perrott, Konstantin Kharitonov, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, dario-piotrowicz, piyush132000 and sr5434

    15.0.3 (2022-12-07)

    common

    Commit Type Description
    50b1c2bf52 fix Don't generate srcsets with very large sources (#47997)

    ... (truncated)

    Commits
    • 9291bd9 refactor(router): Add opt-in provider for upcoming router change (#47988)
    • d181b93 docs(core): Document invalid multi token (#48267)
    • 6c1064c fix(animations): fix incorrect handling of camel-case css properties (#48436)
    • f30d18a fix(common): Fix TestBed.overrideProvider type to include multi (#48424)
    • 1f3e9d9 refactor(migrations): remove unused migrations (#48414)
    • e4dcaa5 fix(core): unable to inject ChangeDetectorRef inside host directives (#48355)
    • c0d0417 refactor(core): simplify array flatten logic (#48358)
    • 40d6a06 refactor(core): remove old AJD workaround for G3 (#48363)
    • 0b04da1 refactor(core): remove several private utils and APIs (#48357)
    • d933b17 refactor(core): remove debug data structures (#48281)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    cla signed dependencies javascript 
    opened by dependabot[bot] 0
  • Documentation for restoreMocks and resetMocks is confusing

    Documentation for restoreMocks and resetMocks is confusing

    Version

    29.3.1

    Steps to reproduce

    read https://jestjs.io/docs/configuration#resetmocks-boolean and https://jestjs.io/docs/configuration#restoremocks-boolean

    Expected behavior

    My understanding of the actual behavior is:

    • clearMocks resets the state on all mocks (including those created by jest.mock, jest.spyOn, jest.fn, etc.)
    • resetMocks does clearMocks and additionally removes mock implementations; it does not unmock anything
    • restoreMocks removes all spies, but does not touch other types of mocks (and does not technically reset the spies if you still have a reference to them, I think, although this is probably enough of an edge case that it doesn't need explicit mention)

    Actual behavior

    The documentation for restoreMocks makes it sound like it does a lot more (both what resetMocks does, and perhaps undoing even jest.mock). The documentation for restoreAllMocks which it links is a bit clearer, so it should probably just pull in some of that text. Arguably it should even be renamed to restoreSpies or something! It would also be nice to explicitly say that resetMocks implies clearMocks but restoreMocks implies neither.

    Additional context

    No response

    Environment

    n/a
    
    Needs Triage Bug Report 
    opened by benjaminjkraft 0
  • [Bug]: changes to path env variable seem not to be used (in connection with ffi-napi and Windows)

    [Bug]: changes to path env variable seem not to be used (in connection with ffi-napi and Windows)

    Version

    29.3.1

    Steps to reproduce

    1. Clone repo https://github.com/mathiasbockwoldt/jest-bug-example
    2. cd jest-bug-example
    3. npm install
    4. node index.js (should print path and dll version without error)
    5. node .\node_modules\jest\bin\jest.js --silent=false (should print same path but error "Dynamic Linking Error: Win32 error 126" which means that the dll could not be found, which is due to the path env variable not being set correctly)

    Make sure to run steps 4 and 5 not in a terminal from within VSCode, as VSCode injects the current path to the path env variable.

    Expected behavior

    I expect the test run with jest to work without error.

    Actual behavior

    Using jest to run, the index.js will print the correct path env variable, but behave as if the path env variable was not set correctly.

    Additional context

    Maybe connected: #3552

    Some more context is described in the readme in the repo https://github.com/mathiasbockwoldt/jest-bug-example

    Environment

    System:
      OS: Windows 10 10.0.19045
      CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
    Binaries:
      Node: 18.12.1 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
      npm: 8.19.2 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD
    npmPackages:
      jest: ^29.3.1 => 29.3.1
    
    Needs Triage Bug Report 
    opened by mathiasbockwoldt 0
  • [Feature]: Allow matchers to invert the flow of control

    [Feature]: Allow matchers to invert the flow of control

    🚀 Feature Proposal

    There is a nice package called wait-for-expect that enables this pattern:

    import waitForExpect from "wait-for-expect";
    
    test("function eventually returns 5", async () => {
      await waitForExpect(async () => {
        await expect(someFunction()).resolves.toEqual(5);
      });
    });
    

    This executes the passed callback continuously with some delay in between until it does not throw, up to a maximum timeout.

    It would be nice to be able to do this within expect itself:

    test("function eventually returns 5", async () => {
      await expect(someFunction).eventually.toEqual(3);
    });
    

    This would also allow us to write matchers for dealing with generators, async generators and observables, in this instance eventually could also work with these types in addition to callbacks.

    Motivation

    The syntax above is terser and matches how your brain actually works when thinking about how the assertion should work, rather than forcing you to invert your thinking and have the waitForExpect surround a separate call to an assertion.

    This would allow users to use the functions in this.util to format the match result and decorate it nicely so that it's simple for the user to understand what went wrong by reading the error message. This isn't possible when using a function such as waitForExpect.

    This functionality could also be really good for writing plugins to provide matchers for dealing with observables (e.g. rxjs), generators and async generators

    Example

    expect.extend({
      eventually: async actual => {
        // grab child matchers from jest and tell jest that we are handling them within this
        // matcher so they don't need to be used again by the framework itself
        const callChildMatcher = this.util.consumeChildMatcher();
        let lastFailure;
        for (let i = 0; i < 10; ++i) {
          lastFailure = await callChildMatcher();
          if (childResult.pass) {
            return childResult; // could also decorate the result here
          }
          await delay(100);
        }
        return lastFailure; // could also decorate the failure here
      }
    });
    

    Then could be used (as shown above) like this:

    test("function eventually returns 5", () => expect(someFunction).eventually.toEqual(3));
    

    Pitch

    There are many other middleware systems that allow you to extend and invert the flow of control, for example in koa you can:

    someMiddleware.use((result, next) => {
      doStuff(result);
      await next(result); // call next middleware
      doMoreStuff(result);
    });
    

    observables, generators and async generators all produce many values instead of a single value, where it can be useful to keep processing the results until the result is available which matches the downstream assertions. Without this functionality it's not possible to write matchers that work with a reactive style of programming.

    I also noted that the rejects/resolves matchers adds promise to this which downstream matchers can use to format their match results nicely. This forces every matcher to then have to consider things like this.promise. With an inverted flow of control the resolves matcher could handle this itself rather than forcing every other possible matcher to worry about whether it was used or not.

    :rocket: Feature Request 
    opened by insidewhy 0
  • chore(deps-dev): bump @typescript-eslint/parser from 5.47.1 to 5.48.0

    chore(deps-dev): bump @typescript-eslint/parser from 5.47.1 to 5.48.0

    Bumps @typescript-eslint/parser from 5.47.1 to 5.48.0.

    Release notes

    Sourced from @​typescript-eslint/parser's releases.

    v5.48.0

    5.48.0 (2023-01-02)

    Bug Fixes

    Features

    • eslint-plugin: specify which method is unbound and added test case (#6281) (cf3ffdd)
    Changelog

    Sourced from @​typescript-eslint/parser's changelog.

    5.48.0 (2023-01-02)

    Note: Version bump only for package @​typescript-eslint/parser

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    cla signed dependencies javascript 
    opened by dependabot[bot] 0
Releases(v29.3.1)
  • v29.3.1(Nov 8, 2022)

  • v29.3.0(Nov 7, 2022)

    Features

    • [jest-runtime] Support WebAssembly (Wasm) imports in ESM modules (#13505)

    Fixes

    • [jest-config] Add config validation for projects option (#13565)
    • [jest-mock] Treat cjs modules as objects so they can be mocked (#13513)
    • [jest-worker] Throw an error instead of hanging when jest workers terminate unexpectedly (#13566)

    Chore & Maintenance

    • [@jest/transform] Update convert-source-map (#13509)
    • [docs] Mention toStrictEqual in UsingMatchers docs. (#13560)

    New Contributors

    • @Tofandel made their first contribution in https://github.com/facebook/jest/pull/13513
    • @RyWilliams made their first contribution in https://github.com/facebook/jest/pull/13520
    • @waikoo made their first contribution in https://github.com/facebook/jest/pull/13447
    • @kachkaev made their first contribution in https://github.com/facebook/jest/pull/13505
    • @ibuibu made their first contribution in https://github.com/facebook/jest/pull/13565
    • @necipallef made their first contribution in https://github.com/facebook/jest/pull/13560
    • @ravshansbox made their first contribution in https://github.com/facebook/jest/pull/13533

    Full Changelog: https://github.com/facebook/jest/compare/v29.2.2...v29.3.0

    Source code(tar.gz)
    Source code(zip)
  • v29.2.2(Oct 24, 2022)

    Fixes

    • [@jest/test-sequencer] Make sure sharding does not produce empty groups (#13476)
    • [jest-circus] Test marked as todo are shown as todo when inside a focussed describe (#13504)
    • [jest-mock] Ensure mock resolved and rejected values are promises from correct realm (#13503)
    • [jest-snapshot] Don't highlight passing asymmetric property matchers in snapshot diff (#13480)

    Chore & Maintenance

    • [docs] Update link to Jest 28 upgrade guide in error message (#13483)
    • [jest-runner, jest-watcher] Update emittery (#13490)

    New Contributors

    • @moonrailgun made their first contribution in https://github.com/facebook/jest/pull/13483
    • @halldorbjarni made their first contribution in https://github.com/facebook/jest/pull/13491

    Full Changelog: https://github.com/facebook/jest/compare/v29.2.1...v29.2.2

    Source code(tar.gz)
    Source code(zip)
  • v29.2.1(Oct 18, 2022)

    Features

    • [@jest/globals, jest-mock] Add jest.Spied* utility types (#13440)

    Fixes

    • [jest-environment-node] make globalThis.performance writable for Node 19 and fake timers (#13467)
    • [jest-mock] Revert #13398 to restore mocking of setters (#13472)

    Performance

    • [*] Use sha1 instead of sha256 for hashing (#13421)

    Full Changelog: https://github.com/facebook/jest/compare/v29.2.0...v29.2.1

    Source code(tar.gz)
    Source code(zip)
  • v29.2.0(Oct 14, 2022)

    Features

    • [@jest/cli, jest-config] A seed for the test run will be randomly generated, or set by a CLI option (#13400)
    • [@jest/cli, jest-config] --show-seed will display the seed value in the report, and can be set via a CLI flag or through the config file (#13400)
    • [jest-config] Add readInitialConfig utility function (#13356)
    • [jest-core] Allow testResultsProcessor to be async (#13343)
    • [@jest/environment, jest-environment-node, jest-environment-jsdom, jest-runtime] Add getSeed() to the jest object (#13400)
    • [expect, @jest/expect-utils] Allow isA utility to take a type argument (#13355)
    • [expect] Expose AsyncExpectationResult and SyncExpectationResult types (#13411)

    Fixes

    • [babel-plugin-jest-hoist] Ignore TSTypeQuery when checking for hoisted references (#13367)
    • [jest-core] Fix detectOpenHandles false positives for some special objects such as TLSWRAP (#13414)
    • [jest-mock] Fix mocking of getters and setters on classes (#13398)
    • [jest-reporters] Revert: Transform file paths into hyperlinks (#13399)
    • [@jest/types] Infer type of each table correctly when the table is a tuple or array (#13381)
    • [@jest/types] Rework typings to allow the *ReturnedWith matchers to be called with no argument (#13385)

    Chore & Maintenance

    • [*] Update @babel/* deps, resulting in slightly different stack traces for each (#13422)

    Performance

    • [jest-runner] Do not instrument v8 coverage data if coverage should not be collected (#13282)

    New Contributors

    • @johannessjoberg made their first contribution in https://github.com/facebook/jest/pull/13343
    • @mitchhentgesspotify made their first contribution in https://github.com/facebook/jest/pull/13282
    • @Methuselah96 made their first contribution in https://github.com/facebook/jest/pull/13409
    • @jhwang98 made their first contribution in https://github.com/facebook/jest/pull/13400
    • @professorjrod made their first contribution in https://github.com/facebook/jest/pull/13418
    • @jesusarell made their first contribution in https://github.com/facebook/jest/pull/13407

    Full Changelog: https://github.com/facebook/jest/compare/v29.1.2...v29.2.0

    Source code(tar.gz)
    Source code(zip)
  • v29.1.2(Sep 30, 2022)

    Fixes

    • [expect, @jest/expect] Revert buggy inference of argument types for *CalledWith and *ReturnedWith matchers introduced in 29.1.0 (#13339)
    • [jest-worker] Add missing dependency on jest-util (#13341)

    New Contributors

    • @brunocabral88 made their first contribution in https://github.com/facebook/jest/pull/13329
    • @alexander-akait made their first contribution in https://github.com/facebook/jest/pull/13341

    Full Changelog: https://github.com/facebook/jest/compare/v29.1.1...v29.1.2

    Source code(tar.gz)
    Source code(zip)
  • v29.1.1(Sep 28, 2022)

  • v29.1.0(Sep 28, 2022)

    Features

    • [expect, @jest/expect] support type inference for function parameters in CalledWith assertions (#13268)
    • [expect, @jest/expect] Infer type of *ReturnedWith matchers argument (#13278)
    • [@jest/environment, jest-runtime] Allow jest.requireActual and jest.requireMock to take a type argument (#13253)
    • [@jest/environment] Allow jest.mock and jest.doMock to take a type argument (#13254)
    • [@jest/fake-timers] Add jest.now() to return the current fake clock time (#13244, #13246)
    • [@jest/mock] Add withImplementation method for temporarily overriding a mock (#13281)
    • [expect] Export toThrow* matchers (#13328)

    Fixes

    • [jest-circus, jest-jasmine2] Fix error messages for Node's assert.throes (#13322)
    • [jest-haste-map] Remove __proto__ usage (#13256)
    • [jest-mock] Improve spyOn typings to handle optional properties (#13247)
    • [jest-mock] Fix mocking of getters and setters on classes (#13145)
    • [jest-snapshot] Throw useful error when an array is passed as property matchers (#13263)
    • [jest-snapshot] Prioritize parser used in the project (#13323)
    • [jest-transform] Attempt to work around issues with atomic writes on Windows (#11423)

    New Contributors

    • @fzn0x made their first contribution in https://github.com/facebook/jest/pull/13234
    • @guimard made their first contribution in https://github.com/facebook/jest/pull/13256
    • @weidehai made their first contribution in https://github.com/facebook/jest/pull/13270
    • @kettanaito made their first contribution in https://github.com/facebook/jest/pull/12871
    • @royhadad made their first contribution in https://github.com/facebook/jest/pull/13279
    • @ghiscoding made their first contribution in https://github.com/facebook/jest/pull/13290
    • @paulreece made their first contribution in https://github.com/facebook/jest/pull/13311
    • @jeppester made their first contribution in https://github.com/facebook/jest/pull/13281
    • @sashashura made their first contribution in https://github.com/facebook/jest/pull/13324
    • @lpizzinidev made their first contribution in https://github.com/facebook/jest/pull/13322
    • @JVBorges made their first contribution in https://github.com/facebook/jest/pull/13323
    • @staplespeter made their first contribution in https://github.com/facebook/jest/pull/13145

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.3...v29.1.0

    Source code(tar.gz)
    Source code(zip)
  • v29.0.3(Sep 10, 2022)

    Features

    • [@jest/environment, jest-runtime] Allow passing a generic type argument to jest.createMockFromModule<T>() method (#13202)
    • [expect] Expose ExpectationResult type (#13240)
    • [jest-snapshot] Expose Context type (#13240)
    • [@jest/globals] Add jest.Mock type helper (#13235)

    Fixes

    • [jest-core] Capture execError during TestScheduler.scheduleTests and dispatch to reporters (#13203)
    • [jest-resolve] Make sure to resolve module paths after looking at exports (#13242)
    • [jest-resolve] Improve error on module not found deep in the require stack (#8704)
    • [jest-snapshot] Fix typings of snapshot matchers (#13240)

    Chore & Maintenance

    • [*] Fix inconsistent workspace prefixes (#13217)
    • [jest-haste-map] Expose a minimal public API to TypeScript (#13023)

    New Contributors

    • @iamWing made their first contribution in https://github.com/facebook/jest/pull/13191
    • @shinxi made their first contribution in https://github.com/facebook/jest/pull/12930
    • @bmish made their first contribution in https://github.com/facebook/jest/pull/13217
    • @maschwenk made their first contribution in https://github.com/facebook/jest/pull/13226

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.2...v29.0.3

    Source code(tar.gz)
    Source code(zip)
  • v29.0.2(Sep 3, 2022)

    Features

    • [jest-transform] Expose TransformFactory type (#13184)

    Fixes

    • [babel-plugin-jest-hoist] Support imported jest in mock factory (#13188)
    • [jest-mock] Align the behavior and return type of generateFromMetadata method (#13207)
    • [jest-runtime] Support jest.resetModules() with ESM (#13211)

    New Contributors

    • @momokid made their first contribution in https://github.com/facebook/jest/pull/13194

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.1...v29.0.2

    Source code(tar.gz)
    Source code(zip)
  • v29.0.1(Aug 26, 2022)

  • v29.0.0(Aug 25, 2022)

    Blog post: https://jestjs.io/blog/2022/08/25/jest-29

    Features

    • [expect] [BREAKING] Differentiate between MatcherContext MatcherUtils and MatcherState types (#13141)
    • [jest-circus] Add support for test.failing.each (#13142)
    • [jest-config] [BREAKING] Make snapshotFormat default to escapeString: false and printBasicPrototype: false (#13036)
    • [jest-config] [BREAKING] Remove undocumented collectCoverageOnlyFrom option (#13156)
    • [jest-environment-jsdom] [BREAKING] Upgrade to jsdom@20 (#13037, #13058)
    • [@jest/globals] Add jest.Mocked, jest.MockedClass, jest.MockedFunction and jest.MockedObject utility types (#12727)
    • [jest-mock] [BREAKING] Refactor Mocked* utility types. MaybeMockedDeep and MaybeMocked became Mocked and MockedShallow respectively; only deep mocked variants of MockedClass, MockedFunction and MockedObject are exported (#13123, #13124)
    • [jest-mock] [BREAKING] Change the default jest.mocked helper’s behavior to deep mocked (#13125)
    • [jest-snapshot] [BREAKING] Let babel find config when updating inline snapshots (#13150)
    • [@jest/test-result, @jest/types] [BREAKING] Replace Bytes and Milliseconds types with number (#13155)
    • [jest-worker] Adds workerIdleMemoryLimit option which is used as a check for worker memory leaks >= Node 16.11.0 and recycles child workers as required (#13056, #13105, #13106, #13107)
    • [pretty-format] [BREAKING] Remove ConvertAnsi plugin in favour of jest-serializer-ansi-escapes (#13040)
    • [pretty-format] Allow to opt out from sorting object keys with compareKeys: null (#12443)

    Fixes

    • [jest-config] Fix testing multiple projects with TypeScript config files (#13099)
    • [@jest/expect-utils] Fix deep equality of ImmutableJS Record (#13055)
    • [jest-haste-map] Increase the maximum possible file size that jest-haste-map can handle (#13094)
    • [jest-runtime] Properly support CJS re-exports from dual packages (#13170)
    • [jest-snapshot] Make prettierPath optional in SnapshotState (#13149)
    • [jest-snapshot] Fix parsing error from inline snapshot files with JSX (#12760)
    • [jest-worker] When a process runs out of memory worker exits correctly and doesn't spin indefinitely (#13054)

    Chore & Maintenance

    • [*] [BREAKING] Drop support for Node v12 and v17 (#13033)
    • [docs] Fix webpack name (#13049)
    • [docs] Explicit how to set n for --bail (#13128)
    • [docs] Update Enzyme URL (#13166)
    • [jest-leak-detector] Remove support for weak-napi (#13035)
    • [jest-snapshot] [BREAKING] Require rootDir as argument to SnapshotState (#13150)

    New Contributors

    • @makstech made their first contribution in https://github.com/facebook/jest/pull/13049
    • @sa2taka made their first contribution in https://github.com/facebook/jest/pull/13055
    • @matheus-rodrigues00 made their first contribution in https://github.com/facebook/jest/pull/13090
    • @lanpai made their first contribution in https://github.com/facebook/jest/pull/13094
    • @Zebreus made their first contribution in https://github.com/facebook/jest/pull/13099
    • @backmask made their first contribution in https://github.com/facebook/jest/pull/13106
    • @liuxingbaoyu made their first contribution in https://github.com/facebook/jest/pull/13120
    • @Trim made their first contribution in https://github.com/facebook/jest/pull/13128
    • @kkyusufk made their first contribution in https://github.com/facebook/jest/pull/13142
    • @KrishnaPG made their first contribution in https://github.com/facebook/jest/pull/13157
    • @dev-itsheng made their first contribution in https://github.com/facebook/jest/pull/13115
    • @jeffslofish made their first contribution in https://github.com/facebook/jest/pull/13166

    Full Changelog: https://github.com/facebook/jest/compare/v28.1.3...v29.0.0

    Source code(tar.gz)
    Source code(zip)
  • v29.0.0-alpha.6(Aug 19, 2022)

    What's Changed

    • chore: update @jridgewell/trace-mapping by @SimenB in https://github.com/facebook/jest/pull/13119
    • refactor(jest-mock)!: rework Mocked* utility types by @mrazauskas in https://github.com/facebook/jest/pull/13123
    • fix(jest-mock): export MockedShallow type by @mrazauskas in https://github.com/facebook/jest/pull/13124
    • feat(@jest/globals): add jest.Mocked, jest.MockedClass, jest.MockedFunction and jest.MockedObject utility types by @mrazauskas in https://github.com/facebook/jest/pull/12727
    • refactor(jest-mock)!: change the default jest.mocked helper’s behaviour to deep mocked by @mrazauskas in https://github.com/facebook/jest/pull/13125
    • chore(types): separate MatcherContext, MatcherUtils and MatcherState by @SimenB in https://github.com/facebook/jest/pull/13141
    • feat(circus): added each to failing tests by @kkyusufk in https://github.com/facebook/jest/pull/13142
    • chore: make prettierPath optional in SnapshotState by @SimenB in https://github.com/facebook/jest/pull/13149
    • feat: Let babel find config when updating inline snapshots by @SimenB in https://github.com/facebook/jest/pull/13150
    • fix: Allow updating inline snapshots when test includes JSX by @eps1lon in https://github.com/facebook/jest/pull/12760

    New Contributors

    • @liuxingbaoyu made their first contribution in https://github.com/facebook/jest/pull/13120
    • @Trim made their first contribution in https://github.com/facebook/jest/pull/13128
    • @kkyusufk made their first contribution in https://github.com/facebook/jest/pull/13142

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.0-alpha.5...v29.0.0-alpha.6

    Source code(tar.gz)
    Source code(zip)
  • v29.0.0-alpha.5(Aug 11, 2022)

    What's Changed

    • fix: pipe workerIdleMemoryLimit to globalConfig by @backmask in https://github.com/facebook/jest/pull/13106
    • fix: worker being killed after being spawned and other worker bugs by @phawxby in https://github.com/facebook/jest/pull/13107

    New Contributors

    • @backmask made their first contribution in https://github.com/facebook/jest/pull/13106

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.0-alpha.4...v29.0.0-alpha.5

    Source code(tar.gz)
    Source code(zip)
  • v29.0.0-alpha.4(Aug 8, 2022)

    What's Changed

    • fix: repair caching of typescript compiler instances by @Zebreus in https://github.com/facebook/jest/pull/13099
    • fix: add workerIdleMemoryLimit to ValidConfig by @AndrewLeedham in https://github.com/facebook/jest/pull/13105

    New Contributors

    • @Zebreus made their first contribution in https://github.com/facebook/jest/pull/13099

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.0-alpha.3...v29.0.0-alpha.4

    Source code(tar.gz)
    Source code(zip)
  • v29.0.0-alpha.3(Aug 7, 2022)

    Features

    • [jest-worker] Adds workerIdleMemoryLimit option which is used as a check for worker memory leaks >= Node 16.11.0 and recycles child workers as required. (#13056)

    Fixes

    • [jest-haste-map] Increase the maximum possible file size that jest-haste-map can handle (#13094)

    New Contributors

    • @matheus-rodrigues00 made their first contribution in https://github.com/facebook/jest/pull/13090
    • @lanpai made their first contribution in https://github.com/facebook/jest/pull/13094

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.0-alpha.1...v29.0.0-alpha.3

    Source code(tar.gz)
    Source code(zip)
  • v29.0.0-alpha.1(Aug 4, 2022)

    Features

    • [pretty-format] [BREAKING] Remove ConvertAnsi plugin in favour of jest-serializer-ansi-escapes (#13040)

    Fixes

    • [jest-worker] When a process runs out of memory worker exits correctly and doesn't spin indefinitely (#13054)
    • [@jest/expect-utils] Fix deep equality of ImmutableJS Record (#13055)

    New Contributors

    • @MaksTech made their first contribution in https://github.com/facebook/jest/pull/13049
    • @sa2taka made their first contribution in https://github.com/facebook/jest/pull/13055

    Full Changelog: https://github.com/facebook/jest/compare/v29.0.0-alpha.0...v29.0.0-alpha.1

    Source code(tar.gz)
    Source code(zip)
  • v29.0.0-alpha.0(Jul 17, 2022)

    Features

    • [jest-config] [BREAKING] Make snapshotFormat default to escapeString: false and printBasicPrototype: false (#13036)
    • [jest-environment-jsdom] [BREAKING] Upgrade to jsdom@20 (#13037)

    Chore & Maintenance

    • [*] [BREAKING] Drop support for Node v12 and v17 (#13033)
    • [jest-leak-detector] Remove support for weak-napi (#13035)

    Full Changelog: https://github.com/facebook/jest/compare/v28.1.3...v29.0.0-alpha.0

    Source code(tar.gz)
    Source code(zip)
  • v28.1.3(Jul 13, 2022)

    Features

    • [jest-leak-detector] Use native FinalizationRegistry when it exists to get rid of external C dependency (#12973)

    Fixes

    • [jest-changed-files] Fix a lock-up after repeated invocations (#12757)
    • [@jest/expect-utils] Fix deep equality of ImmutableJS OrderedSets (#12977)
    • [jest-mock] Add index signature support for spyOn types (#13013, #13020)
    • [jest-snapshot] Fix indentation of awaited inline snapshots (#12986)

    Chore & Maintenance

    • [*] Replace internal usage of pretty-format/ConvertAnsi with jest-serializer-ansi-escapes (#12935, #13004)
    • [docs] Update spyOn docs (#13000)

    New Contributors

    • @joshkel made their first contribution in https://github.com/facebook/jest/pull/12960
    • @enrilzhou made their first contribution in https://github.com/facebook/jest/pull/12973
    • @milahu made their first contribution in https://github.com/facebook/jest/pull/12983
    • @MiguelYax made their first contribution in https://github.com/facebook/jest/pull/13000
    • @kaffarell made their first contribution in https://github.com/facebook/jest/pull/13015
    • @TheKhanj made their first contribution in https://github.com/facebook/jest/pull/12988
    • @Fdawgs made their first contribution in https://github.com/facebook/jest/pull/13019

    Full Changelog: https://github.com/facebook/jest/compare/v28.1.2...v28.1.3

    Source code(tar.gz)
    Source code(zip)
  • v28.1.2(Jun 29, 2022)

    Fixes

    • [jest-runtime] Avoid star type import from @jest/globals (#12949)

    Chore & Maintenance

    • [docs] Mention that jest-codemods now supports Sinon (#12898)

    New Contributors

    • @danbeam made their first contribution in https://github.com/facebook/jest/pull/12898
    • @DanRowe made their first contribution in https://github.com/facebook/jest/pull/12915

    Full Changelog: https://github.com/facebook/jest/compare/v28.1.1...v28.1.2

    Source code(tar.gz)
    Source code(zip)
  • v28.1.1(Jun 7, 2022)

    Features

    • [jest] Expose Config type (#12848)
    • [@jest/reporters] Improve GitHubActionsReporters annotation format (#12826)
    • [@jest/types] Infer argument types passed to test and describe callback functions from each tables (#12885, #12905)

    Fixes

    • [@jest/expect-utils] Fix deep equality of ImmutableJS OrderedMaps (#12763)
    • [jest-docblock] Handle multiline comments in parseWithComments (#12845)
    • [jest-mock] Improve spyOn error messages (#12901)
    • [jest-runtime] Correctly report V8 coverage with resetModules: true (#12912)
    • [jest-worker] Make JestWorkerFarm helper type to include methods of worker module that take more than one argument (#12839)

    Chore & Maintenance

    • [docs] Updated docs to indicate that jest-environment-jsdom is a separate package #12828

    • [docs] Document the comments used by coverage providers #12835

    • [docs] Use docusaurus-remark-plugin-tab-blocks to format tabs with code examples (#12859)

    • [jest-haste-map] Bump walker version (#12324)

    • [expect] Adjust typings of lastCalledWith, nthCalledWith, toBeCalledWith matchers to allow a case there a mock was called with no arguments (#12807)

    • [@jest/expect-utils] Fix deep equality of ImmutableJS Lists (#12763)

    • [jest-core] Do not collect SIGNREQUEST as open handles (#12789)

    New Contributors

    • @owjsub made their first contribution in https://github.com/facebook/jest/pull/12324
    • @Aveline-art made their first contribution in https://github.com/facebook/jest/pull/12831
    • @spenserblack made their first contribution in https://github.com/facebook/jest/pull/12836
    • @dimitropoulos made their first contribution in https://github.com/facebook/jest/pull/12817
    • @ullumullu made their first contribution in https://github.com/facebook/jest/pull/12845
    • @limonte made their first contribution in https://github.com/facebook/jest/pull/12851
    • @Dennis273 made their first contribution in https://github.com/facebook/jest/pull/12870
    • @shreykinshu made their first contribution in https://github.com/facebook/jest/pull/12886
    • @pbomb made their first contribution in https://github.com/facebook/jest/pull/12899
    • @ChrisCoastal made their first contribution in https://github.com/facebook/jest/pull/12887
    • @HyunseungLee-Travis made their first contribution in https://github.com/facebook/jest/pull/12810

    Full Changelog: https://github.com/facebook/jest/compare/v28.1.0...v28.1.1

    Source code(tar.gz)
    Source code(zip)
  • v28.1.0(May 6, 2022)

    Features

    • [jest-circus] Add failing test modifier that inverts the behaviour of tests (#12610)
    • [jest-environment-node, jest-environment-jsdom] Allow specifying customExportConditions (#12774)

    Fixes

    • [expect] Adjust typings of lastCalledWith, nthCalledWith, toBeCalledWith matchers to allow a case there a mock was called with no arguments (#12807)
    • [@jest/expect-utils] Fix deep equality of ImmutableJS Lists (#12763)
    • [jest-core] Do not collect SIGNREQUEST as open handles (#12789)

    Chore & Maintenance

    • [docs] Specified documentation about --filter CLI docs (#12799)
    • [@jest-reporters] Move helper functions from utils.ts into separate files (#12782)
    • [jest-resolve] Replace process.versions.pnp type declaration with @types/pnpapi devDependency (#12783)

    New Contributors

    • @romellem made their first contribution in https://github.com/facebook/jest/pull/12763
    • @cristianrgreco made their first contribution in https://github.com/facebook/jest/pull/12789
    • @rethab made their first contribution in https://github.com/facebook/jest/pull/12791
    • @gramsco made their first contribution in https://github.com/facebook/jest/pull/12799
    • @michalwarda made their first contribution in https://github.com/facebook/jest/pull/12610
    • @mikemaccana made their first contribution in https://github.com/facebook/jest/pull/12809

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.3...v28.1.0

    Source code(tar.gz)
    Source code(zip)
  • v28.0.3(Apr 29, 2022)

    Fixes

    • [jest-config] Normalize reporters option defined in presets (#12769)
    • [@jest/reporters] Fix trailing slash in matching coverageThreshold key (#12714)
    • [jest-resolve] Fix (experimental) ESM module mocking for re-exports (#12766)
    • [@jest/transform] Throw better error if an invalid return value if encountered (#12764)

    Chore & Maintenance

    • [docs] Fix typo in --shard CLI docs (#12761)

    New Contributors

    • @wespickett made their first contribution in https://github.com/facebook/jest/pull/12714
    • @helloitsjoe made their first contribution in https://github.com/facebook/jest/pull/12761
    • @maxdavidson made their first contribution in https://github.com/facebook/jest/pull/12766

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.2...v28.0.3

    Source code(tar.gz)
    Source code(zip)
  • v28.0.2(Apr 27, 2022)

    Features

    • [jest-worker] Add JestWorkerFarm helper type (#12753)

    Fixes

    • [*] Lower Node 16 requirement to 16.10 from 16.13 due to a Node bug that causes memory and performance issues (#12754)

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.1...v28.0.2

    Source code(tar.gz)
    Source code(zip)
  • v28.0.1(Apr 26, 2022)

    Features

    • [jest-resolve] Expose ResolverOptions type (#12736)

    Fixes

    • [expect] Add missing dependency jest-util (#12744)
    • [jest-circus] Improve test.concurrent (#12748)
    • [jest-resolve] Correctly throw an error if jsdom test environment is used, but not installed (#12749)

    Chore & Maintenance

    • [jest-serializer] Remove deprecated module from source tree (#12735)

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.0...v28.0.1

    Source code(tar.gz)
    Source code(zip)
  • v28.0.0(Apr 25, 2022)

    Blog post: https://jestjs.io/blog/2022/04/25/jest-28

    Features

    • [babel-jest] Export createTransformer function (#12399)
    • [expect] Expose AsymmetricMatchers, MatcherFunction and MatcherFunctionWithState interfaces (#12363, #12376)
    • [jest-circus] Support error logging before retry (#12201)
    • [jest-circus, jest-jasmine2] Allowed classes and functions as describe and it/test names (#12484)
    • [jest-cli, jest-config] [BREAKING] Remove testURL config, use testEnvironmentOptions.url instead (#10797)
    • [jest-cli, jest-core] Add --shard parameter for distributed parallel test execution (#12546)
    • [jest-cli] [BREAKING] Remove undocumented --timers option (#12572)
    • [jest-config] [BREAKING] Stop shipping jest-environment-jsdom by default (#12354)
    • [jest-config] [BREAKING] Stop shipping jest-jasmine2 by default (#12355)
    • [jest-config, @jest/types] Add ci to GlobalConfig (#12378)
    • [jest-config] [BREAKING] Rename moduleLoader to runtime (#10817)
    • [jest-config] [BREAKING] Rename extraGlobals to sandboxInjectedGlobals (#10817)
    • [jest-config] [BREAKING] Throw an error instead of showing a warning if multiple configs are used (#12510)
    • [jest-config] [BREAKING] Do not normalize long deprecated configuration options preprocessorIgnorePatterns, scriptPreprocessor, setupTestFrameworkScriptFile and testPathDirs (#12701)
    • [jest-cli, jest-core] Add --ignoreProjects CLI argument to ignore test suites by project name (#12620)
    • [jest-core] Pass project config to globalSetup/globalTeardown function as second argument (#12440)
    • [jest-core] Stabilize test runners with event emitters (#12641)
    • [jest-core, jest-watcher] [BREAKING] Move TestWatcher class to jest-watcher package (#12652)
    • [jest-core] Allow using Summary Reporter as stand-alone reporter (#12687)
    • [jest-environment-jsdom] [BREAKING] Upgrade jsdom to 19.0.0 (#12290)
    • [jest-environment-jsdom] [BREAKING] Add default browser condition to exportConditions for jsdom environment (#11924)
    • [jest-environment-jsdom] [BREAKING] Pass global config to Jest environment constructor for jsdom environment (#12461)
    • [jest-environment-jsdom] [BREAKING] Second argument context to constructor is mandatory (#12469)
    • [jest-environment-node] [BREAKING] Add default node and node-addon conditions to exportConditions for node environment (#11924)
    • [jest-environment-node] [BREAKING] Pass global config to Jest environment constructor for node environment (#12461)
    • [jest-environment-node] [BREAKING] Second argument context to constructor is mandatory (#12469)
    • [jest-environment-node] Add all available globals to test globals, not just explicit ones (#12642, #12696)
    • [@jest/expect] New module which extends expect with jest-snapshot matchers (#12404, #12410, #12418)
    • [@jest/expect-utils] New module exporting utils for expect (#12323)
    • [@jest/fake-timers] [BREAKING] Rename timers configuration option to fakeTimers (#12572)
    • [@jest/fake-timers] [BREAKING] Allow jest.useFakeTimers() and projectConfig.fakeTimers to take an options bag (#12572)
    • [jest-haste-map] [BREAKING] HasteMap.create now returns a promise (#12008)
    • [jest-haste-map] Add support for dependencyExtractor written in ESM (#12008)
    • [jest-mock] [BREAKING] Rename exported utility types ClassLike, FunctionLike, ConstructorLikeKeys, MethodLikeKeys, PropertyLikeKeys; remove exports of utility types ArgumentsOf, ArgsType, ConstructorArgumentsOf - TS builtin utility types ConstructorParameters and Parameters should be used instead (#12435, #12489)
    • [jest-mock] Improve isMockFunction to infer types of passed function (#12442)
    • [jest-mock] [BREAKING] Improve the usage of jest.fn generic type argument (#12489)
    • [jest-mock] Add support for auto-mocking async generator functions (#11080)
    • [jest-mock] Add contexts member to mock functions (#12601)
    • [@jest/reporters] Add GitHub Actions reporter (#11320, #12658)
    • [@jest/reporters] Pass reporterContext to custom reporter constructors as third argument (#12657)
    • [jest-resolve] [BREAKING] Add support for package.json exports (#11961, #12373)
    • [jest-resolve] Support package self-reference (#12682)
    • [jest-resolve, jest-runtime] Add support for data: URI import and mock (#12392)
    • [jest-resolve, jest-runtime] Add support for async resolver (#11540)
    • [jest-resolve] [BREAKING] Remove browser?: boolean from resolver options, conditions: ['browser'] should be used instead (#12707)
    • [jest-resolve] Expose JestResolver, AsyncResolver, SyncResolver, PackageFilter, PathFilter and PackageJSON types (#12707, (#12712)
    • [jest-runner] Allow setupFiles module to export an async function (#12042)
    • [jest-runner] Allow passing testEnvironmentOptions via docblocks (#12470)
    • [jest-runner] Expose CallbackTestRunner, EmittingTestRunner abstract classes and CallbackTestRunnerInterface, EmittingTestRunnerInterface to help typing third party runners (#12646, #12715)
    • [jest-runner] Lock version of source-map-support to 0.5.13 (#12720)
    • [jest-runtime] [BREAKING] Runtime.createHasteMap now returns a promise (#12008)
    • [jest-runtime] Calling jest.resetModules function will clear FS and transform cache (#12531)
    • [jest-runtime] [BREAKING] Remove Context type export, it must be imported from @jest/test-result (#12685)
    • [jest-runtime] Add import.meta.jest (#12698)
    • [@jest/schemas] New module for JSON schemas for Jest's config (#12384)
    • [@jest/source-map] Migrate from source-map to @jridgewell/trace-mapping (#12692)
    • [jest-transform] [BREAKING] Make it required for process() and processAsync() methods to always return structured data (#12638)
    • [jest-test-result] Add duration property to JSON test output (#12518)
    • [jest-watcher] [BREAKING] Make PatternPrompt class to take entityName as third constructor parameter instead of this._entityName (#12591)
    • [jest-worker] [BREAKING] Allow only absolute workerPath (#12343)
    • [jest-worker] [BREAKING] Default to advanced serialization when using child process workers (#10983)
    • [pretty-format] New maxWidth parameter (#12402)

    Fixes

    • [*] Use sha256 instead of md5 as hashing algortihm for compatibility with FIPS systems (#12722)
    • [babel-jest] [BREAKING] Pass rootDir as root in Babel's options (#12689)
    • [expect] Move typings of .not, .rejects and .resolves modifiers outside of Matchers interface (#12346)
    • [expect] Throw useful error if expect.extend is called with invalid matchers (#12488)
    • [expect] Fix iterableEquality ignores other properties (#8359)
    • [expect] Fix print for the closeTo matcher (#12626)
    • [jest-changed-files] Improve changedFilesWithAncestor pattern for Mercurial SCM (#12322)
    • [jest-circus, @jest/types] Disallow undefined value in TestContext type (#12507)
    • [jest-config] Correctly detect CI environment and update snapshots accordingly (#12378)
    • [jest-config] Pass moduleTypes to ts-node to enforce CJS when transpiling (#12397)
    • [jest-config] [BREAKING] Add mjs and cjs to default moduleFileExtensions config (#12578)
    • [jest-config, jest-haste-map] Allow searching for tests in node_modules by exposing retainAllFiles (#11084)
    • [jest-core] [BREAKING] Exit with status 1 if no tests are found with --findRelatedTests flag (#12487)
    • [jest-core] Do not report unref-ed subprocesses as open handles (#12705)
    • [jest-each] %# is not replaced with index of the test case (#12517)
    • [jest-each] Fixes error message with incorrect count of missing arguments (#12464)
    • [jest-environment-jsdom] Make jsdom accessible to extending environments again (#12232)
    • [jest-environment-jsdom] Log JSDOM errors more cleanly (#12386)
    • [jest-environment-node] Add MessageChannel, MessageEvent to globals (#12553)
    • [jest-environment-node] Add structuredClone to globals (#12631)
    • [@jest/expect-utils] [BREAKING] Fix false positives when looking for undefined prop (#8923)
    • [jest-haste-map] Don't use partial results if file crawl errors (#12420)
    • [jest-haste-map] Make watchman existence check lazy+async (#12675)
    • [jest-jasmine2, jest-types] [BREAKING] Move all jasmine specific types from @jest/types to its own package (#12125)
    • [jest-jasmine2] Do not set duration to 0 for skipped tests (#12518)
    • [jest-matcher-utils] Pass maxWidth to pretty-format to avoid printing every element in arrays by default (#12402)
    • [jest-mock] Fix function overloads for spyOn to allow more correct type inference in complex object (#12442)
    • [jest-mock] Handle overridden Function.name property (#12674)
    • [@jest/reporters] Notifications generated by the --notify flag are no longer persistent in GNOME Shell. (#11733)
    • [@jest/reporters] Move missing icon file which is needed for NotifyReporter class. (#12593)
    • [@jest/reporters] Update v8-to-istanbul (#12697)
    • [jest-resolver] Call custom resolver with core node.js modules (#12654)
    • [jest-runner] Correctly resolve source-map-support (#12706)
    • [jest-worker] Fix Farm execution results memory leak (#12497)

    Chore & Maintenance

    • [*] [BREAKING] Drop support for Node v10 and v15 and target first LTS 16.13.0 (#12220)
    • [*] [BREAKING] Drop support for [email protected], minimum version is now 4.3 (#11142, #12648)
    • [*] Bundle all .d.ts files into a single index.d.ts per module (#12345)
    • [*] Use globalThis instead of global (#12447)
    • [babel-jest] [BREAKING] Only export createTransformer (#12407)
    • [docs] Add note about not mixing done() with Promises (#11077)
    • [docs, examples] Update React examples to match with the new React guidelines for code examples (#12217)
    • [docs] Add clarity for module factory hoisting limitations (#12453)
    • [docs] Add more information about how code transformers work (#12407)
    • [docs] Add upgrading guide (#12633)
    • [expect] [BREAKING] Remove support for importing build/utils (#12323)
    • [expect] [BREAKING] Migrate to ESM (#12344)
    • [expect] [BREAKING] Snapshot matcher types are moved to @jest/expect (#12404)
    • [jest-cli] Update yargs to v17 (#12357)
    • [jest-config] [BREAKING] Remove getTestEnvironment export (#12353)
    • [jest-config] [BREAKING] Rename config option name to id (#11981)
    • [jest-create-cache-key-function] Added README.md file with basic usage instructions (#12492)
    • [@jest/core] Use index.ts instead of jest.ts as main export (#12329)
    • [jest-environment-jsdom] [BREAKING] Migrate to ESM (#12340)
    • [jest-environment-node] [BREAKING] Migrate to ESM (#12340)
    • [jest-haste-map] Remove legacy isRegExpSupported (#12676)
    • [@jest/fake-timers] Update @sinonjs/fake_timers to v9 (#12357)
    • [jest-jasmine2, jest-runtime] [BREAKING] Use Symbol to pass jest.setTimeout value instead of jasmine specific logic (#12124)
    • [jest-phabricator] [BREAKING] Migrate to ESM (#12341)
    • [jest-resolve] [BREAKING] Make requireResolveFunction argument mandatory (#12353)
    • [jest-runner] [BREAKING] Remove some type exports from @jest/test-result (#12353)
    • [jest-runner] [BREAKING] Second argument to constructor (Context) is not optional (#12640)
    • [jest-serializer] [BREAKING] Deprecate package in favour of using v8 APIs directly (#12391)
    • [jest-snapshot] [BREAKING] Migrate to ESM (#12342)
    • [jest-transform] Update write-file-atomic to v4 (#12357)
    • [jest-types] [BREAKING] Remove Config.Glob and Config.Path (#12406)
    • [jest] Use index.ts instead of jest.ts as main export (#12329)

    Performance

    • [jest-haste-map] [BREAKING] Default to node crawler over shelling out to find if watchman is not enabled (#12320)

    New Contributors

    • @marcelltoth made their first contribution in https://github.com/facebook/jest/pull/12290
    • @soryy708 made their first contribution in https://github.com/facebook/jest/pull/12010
    • @dmitryvinn-fb made their first contribution in https://github.com/facebook/jest/pull/12379
    • @cola119 made their first contribution in https://github.com/facebook/jest/pull/12375
    • @holylander made their first contribution in https://github.com/facebook/jest/pull/12257
    • @jsjoeio made their first contribution in https://github.com/facebook/jest/pull/11077
    • @tbossi made their first contribution in https://github.com/facebook/jest/pull/12392
    • @ryanwilsonperkin made their first contribution in https://github.com/facebook/jest/pull/12402
    • @yesmeck made their first contribution in https://github.com/facebook/jest/pull/12408
    • @benblank made their first contribution in https://github.com/facebook/jest/pull/12441
    • @john-u made their first contribution in https://github.com/facebook/jest/pull/12453
    • @cjr125 made their first contribution in https://github.com/facebook/jest/pull/11084
    • @davidjgoss made their first contribution in https://github.com/facebook/jest/pull/11566
    • @SixTfour made their first contribution in https://github.com/facebook/jest/pull/8923
    • @aditya04848 made their first contribution in https://github.com/facebook/jest/pull/12385
    • @rick-shar-ww made their first contribution in https://github.com/facebook/jest/pull/8333
    • @shooit made their first contribution in https://github.com/facebook/jest/pull/11080
    • @d7my11 made their first contribution in https://github.com/facebook/jest/pull/8359
    • @BudgieInWA made their first contribution in https://github.com/facebook/jest/pull/11733
    • @IIIEII made their first contribution in https://github.com/facebook/jest/pull/12497
    • @mhnaeem made their first contribution in https://github.com/facebook/jest/pull/12492
    • @adrianbienias made their first contribution in https://github.com/facebook/jest/pull/12501
    • @TrickyPi made their first contribution in https://github.com/facebook/jest/pull/12510
    • @F3n67u made their first contribution in https://github.com/facebook/jest/pull/12517
    • @dmitryvinn made their first contribution in https://github.com/facebook/jest/pull/12532
    • @brandon-leapyear made their first contribution in https://github.com/facebook/jest/pull/12526
    • @marionebl made their first contribution in https://github.com/facebook/jest/pull/12546
    • @matthias-ccri made their first contribution in https://github.com/facebook/jest/pull/12601
    • @Kaiguang made their first contribution in https://github.com/facebook/jest/pull/12616
    • @ockham made their first contribution in https://github.com/facebook/jest/pull/11320
    • @msonnberger made their first contribution in https://github.com/facebook/jest/pull/12608
    • @nate-io made their first contribution in https://github.com/facebook/jest/pull/12607
    • @fatso83 made their first contribution in https://github.com/facebook/jest/pull/12407
    • @Araxeus made their first contribution in https://github.com/facebook/jest/pull/12631
    • @Udit-takkar made their first contribution in https://github.com/facebook/jest/pull/11981
    • @ChocolateLoverRaj made their first contribution in https://github.com/facebook/jest/pull/12654
    • @adi611 made their first contribution in https://github.com/facebook/jest/pull/12555
    • @fisker made their first contribution in https://github.com/facebook/jest/pull/12653
    • @flakolefluk made their first contribution in https://github.com/facebook/jest/pull/12464
    • @L4vlet made their first contribution in https://github.com/facebook/jest/pull/12626
    • @Gerrit0 made their first contribution in https://github.com/facebook/jest/pull/12612
    • @robhogan made their first contribution in https://github.com/facebook/jest/pull/12676
    • @wrslatz made their first contribution in https://github.com/facebook/jest/pull/12693
    • @katlim-br made their first contribution in https://github.com/facebook/jest/pull/12702
    • @zackasaurus made their first contribution in https://github.com/facebook/jest/pull/12201
    • @darmbrust made their first contribution in https://github.com/facebook/jest/pull/12722
    • @Ash-KODES made their first contribution in https://github.com/facebook/jest/pull/12565

    Full Changelog: https://github.com/facebook/jest/compare/v27.5.1...v28.0.0

    Source code(tar.gz)
    Source code(zip)
  • v28.0.0-alpha.11(Apr 20, 2022)

    Features

    • [jest-runtime] Add import.meta.jest (#12698)
    • [@jest/source-map] Migrate from source-map to @jridgewell/trace-mapping (#12692)
    • [jest-worker] [BREAKING] Default to advanced serialization when using child process workers (#10983)

    Fixes

    • [@jest/reporters] Update v8-to-istanbul (#12697)

    New Contributors

    • @wrslatz made their first contribution in https://github.com/facebook/jest/pull/12693

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.0-alpha.10...v28.0.0-alpha.11

    Source code(tar.gz)
    Source code(zip)
  • v28.0.0-alpha.10(Apr 20, 2022)

    Features

    • [jest-environment-node] Add all available globals to test globals, not just explicit ones (#12696)
    • [@jest/source-map] Migrate from source-map to @jridgewell/trace-mapping (#12692)

    Fixes

    • [babel-jest] [BREAKING] Pass rootDir as root in Babel's options (#12689)

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.0-alpha.9...v28.0.0-alpha.10

    Source code(tar.gz)
    Source code(zip)
  • v28.0.0-alpha.9(Apr 19, 2022)

    Features

    • [jest-core] Stabilize test runners with event emitters (#12641)
    • [jest-core, jest-watcher] [BREAKING] Move TestWatcher class to jest-watcher package (#12652)
    • [jest-core] Allow using Summary Reporter as stand-alone reporter (#12687)
    • [jest-environment-node] Add all available globals to test globals, not just explicit ones (#12642)
    • [@jest/reporters] Add GitHub Actions reporter (#12658)
    • [@jest/reporters] Pass reporterContext to custom reporter constructors as third argument (#12657)
    • [jest-resolve] Support package self-reference (#12682)
    • [jest-runner] Exposing CallbackTestRunner, EmittingTestRunner abstract classes to help typing third party runners (#12646)
    • [jest-runtime] [BREAKING] Remove Context type export, it must be imported from @jest/test-result (#12685)
    • [jest-transform] [BREAKING] Make it required for process() and processAsync() methods to always return structured data (#12638)

    Fixes

    • [expect] Fix print for the closeTo matcher (#12626)
    • [jest-each] Fixes error message with incorrect count of missing arguments (#12464)
    • [jest-haste-map] Make watchman existence check lazy+async (#12675)
    • [jest-mock] Handle overridden Function.name property (#12674)
    • [jest-resolver] Call custom resolver with core node.js modules (#12654)

    Chore & Maintenance

    • [*] [BREAKING] Drop support for [email protected], minimum version is now 4.3 (#12648)
    • [docs] Add upgrading guide (#12633)
    • [jest-config] [BREAKING] Rename config option name to id (#11981)
    • [jest-haste-map] Remove legacy isRegExpSupported (#12676)
    • [jest-runner] [BREAKING] Second argument to constructor (Context) is not optional (#12640)

    New Contributors

    • @Udit-takkar made their first contribution in https://github.com/facebook/jest/pull/11981
    • @ChocolateLoverRaj made their first contribution in https://github.com/facebook/jest/pull/12654
    • @adi611 made their first contribution in https://github.com/facebook/jest/pull/12555
    • @fisker made their first contribution in https://github.com/facebook/jest/pull/12653
    • @flakolefluk made their first contribution in https://github.com/facebook/jest/pull/12464
    • @L4vlet made their first contribution in https://github.com/facebook/jest/pull/12626
    • @Gerrit0 made their first contribution in https://github.com/facebook/jest/pull/12612
    • @robhogan made their first contribution in https://github.com/facebook/jest/pull/12676

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.0-alpha.8...v28.0.0-alpha.9

    Source code(tar.gz)
    Source code(zip)
  • v28.0.0-alpha.8(Apr 5, 2022)

    Features

    • [jest-cli] [BREAKING] Remove undocumented --timers option (#12572)
    • [jest-cli, jest-core] Add --ignoreProjects CLI argument to ignore test suites by project name (#12620)
    • [@jest/fake-timers] [BREAKING] Rename timers configuration option to fakeTimers (#12572)
    • [@jest/fake-timers] [BREAKING] Allow jest.useFakeTimers() and projectConfig.fakeTimers to take an options bag (#12572)
    • [jest-mock] Add contexts member to mock functions (#12601)
    • [jest-reporters] Add GitHub Actions reporter (#11320)
    • [jest-watcher] [BREAKING] Make PatternPrompt class to take entityName as third constructor parameter instead of this._entityName (#12591)

    Fixes

    • [jest-config] [BREAKING] Add mjs and cjs to default moduleFileExtensions config (#12578)
    • [jest-environment-node] Add MessageChannel, MessageEvent to globals (#12553)
    • [jest-environment-node] Add structuredClone to globals (#12631)
    • [@jest/reporters] Move missing icon file which is needed for NotifyReporter class. (#12593)

    Chore & Maintenance

    • [babel-jest] [BREAKING] Only export createTransformer (#12407)
    • [docs] Add more information about how code transformers work (#12407)

    New Contributors

    • @matthias-ccri made their first contribution in https://github.com/facebook/jest/pull/12601
    • @Kaiguang made their first contribution in https://github.com/facebook/jest/pull/12616
    • @ockham made their first contribution in https://github.com/facebook/jest/pull/11320
    • @msonnberger made their first contribution in https://github.com/facebook/jest/pull/12608
    • @nate-io made their first contribution in https://github.com/facebook/jest/pull/12607
    • @fatso83 made their first contribution in https://github.com/facebook/jest/pull/12407
    • @Araxeus made their first contribution in https://github.com/facebook/jest/pull/12631

    Full Changelog: https://github.com/facebook/jest/compare/v28.0.0-alpha.7...v28.0.0-alpha.8

    Source code(tar.gz)
    Source code(zip)
Owner
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
Facebook
Simple JavaScript testing framework for browsers and node.js

A JavaScript Testing Framework Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any Ja

Jasmine 15.5k Jan 2, 2023
🔮 An easy-to-use JavaScript unit testing framework.

QUnit - A JavaScript Unit Testing Framework. QUnit is a powerful, easy-to-use, JavaScript unit testing framework. It's used by the jQuery project to t

QUnit 4k Jan 2, 2023
A Node.js tool to automate end-to-end web testing.

A Node.js tool to automate end-to-end web testing. Write tests in JS or TypeScript, run them and view results. Homepage • Documentation • FAQ • Suppor

Developer Express Inc. 9.5k Jan 9, 2023
Simple interactive HTTP response mocker, useful for testing API callouts.

Simple interactive HTTP response mocker, useful for testing API callouts.

null 1 Jul 1, 2022
The goal of this app is to make user life easier while testing their own apps

Manual testing app The goal of this app is to make user life easier while testing their own apps. It is used to create the testing workflow, record te

null 1 Jan 2, 2023
blanket.js is a simple code coverage library for javascript. Designed to be easy to install and use, for both browser and nodejs.

Blanket.js A seamless JavaScript code coverage library. FYI: Please note that this repo is not actively maintained If you're looking for a more active

Alex Seville 1.4k Dec 16, 2022
JSCover is a JavaScript Code Coverage Tool that measures line, branch and function coverage

JSCover - A JavaScript code coverage measurement tool. JSCover is an easy-to-use JavaScript code coverage measuring tool. It is an enhanced version of

null 392 Nov 20, 2022
☕️ simple, flexible, fun javascript test framework for node.js & the browser

☕️ Simple, flexible, fun JavaScript test framework for Node.js & The Browser ☕️ Links Documentation Release Notes / History / Changes Code of Conduct

Mocha 21.8k Dec 30, 2022
Demo Selenium JavaScript E2E tests (end-to-end web browser automation tests)

Demo Selenium JavaScript E2E tests (end-to-end web browser automation tests)

Joel Parker Henderson 1 Oct 9, 2021
Jest is a delightful JavaScript Testing Framework with a focus on simplicity.

Getting Started with Jest Jest is a delightful JavaScript Testing Framework with a focus on simplicity. Built With Javascript Linters Jest Live Demo N

Didier Peran Ganthier 4 Dec 20, 2022
A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.

SimpleMDE - Markdown Editor A drop-in JavaScript textarea replacement for writing beautiful and understandable Markdown. The WYSIWYG-esque editor allo

Sparksuite 9.3k Jan 4, 2023
A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo · Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Remix Stacks 18 Oct 31, 2022
Delightful, performance-focused pure css loading animations.

Loaders.css Delightful and performance-focused pure css loading animations. What is this? See the demo A collection of loading animations written enti

Connor Atherton 10.2k Jan 4, 2023
Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach (v3)

Javascript Testing, a Practical Approach Description This is the reference repository with all the contents and the examples of the "Javascript Testin

Stefano Magni 2 Nov 14, 2022
🐐 Simple and complete React DOM testing utilities that encourage good testing practices.

React Testing Library Simple and complete React DOM testing utilities that encourage good testing practices. Read The Docs | Edit the docs Table of Co

Testing Library 17.3k Jan 4, 2023
🐐 Simple and complete React DOM testing utilities that encourage good testing practices.

React Testing Library Simple and complete React DOM testing utilities that encourage good testing practices. Read The Docs | Edit the docs Table of Co

Testing Library 17.3k Jan 4, 2023
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

?? Playwright Documentation | API reference Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit w

Microsoft 46.3k Jan 9, 2023
AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool.

AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool. Test restful API by record, replay and stub request/response. Differential

ArexTest 15 Nov 1, 2022
JavaScript Testing utilities for React

Enzyme Enzyme is a JavaScript Testing utility for React that makes it easier to test your React Components' output. You can also manipulate, traverse,

enzyme - JavaScript Testing utilities for React 20k Dec 28, 2022
A next-generation code testing stack for JavaScript.

Intern Software testing for humans ⚠️ This documentation is for the development version of Intern. For the current release version, go here. Intern is

Intern: next-gen JavaScript testing 4.4k Jan 7, 2023