Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-mock

Package Overview
Dependencies
Maintainers
6
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-mock - npm Package Versions

1
2223

11.0.1

Diff

Changelog

Source

jest-cli 11.0.1, babel-jest 11.0.1

  • Added support for Mercurial repositories when using jest -o
  • Added mockImplementationOnce API to jest.fn().
cpojer
published 11.0.0 •

Changelog

Source

jest-cli 11.0.0, babel-jest 11.0.0 (pre-releases 0.9 to 0.10)

  • New implementation of node-haste and rewrite of internal module loading and resolution. Fixed both startup and runtime performance. #599
  • Jasmine 2 is now the default test runner. To keep using Jasmine 1, put testRunner: "jasmine1" into your configuration.
  • Added jest-util, jest-mock, jest-jasmine1, jest-jasmine2, jest-environment-node, jest-environment-jsdom packages.
  • Added babel-jest-preset and babel-jest as packages. babel-jest is now being auto-detected.
  • Added babel-plugin-jest-hoist which hoists jest.unmock, jest.mock and the new jest.enableAutomock and jest.disableAutomock API.
  • Improved babel-jest integration and react-native testing.
  • Improved code coverage reporting when using babel-jest.
  • Added the jest.mock('moduleName', moduleFactory) feature. jest.mock now gets hoisted by default. jest.doMock was added to explicitly mock a module without the hoisting feature of babel-jest.
  • Updated jsdom to 8.3.x.
  • Improved responsiveness of the system while using --watch.
  • Clear the terminal window when using --watch.
  • By default, --watch will now only runs tests related to changed files. --watch=all can be used to run all tests on file system changes.
  • Debounce --watch re-runs to not trigger test runs during a branch switch in version control.
  • Added jest.fn() and jest.fn(implementation) as convenient shortcuts for jest.genMockFunction() and jest.genMockFunction().mockImplementation().
  • Added an automock option to turn off automocking globally.
  • Added a "no tests found" message if no tests can be found.
  • Jest sets process.NODE_ENV to test unless otherwise specified.
  • Fixed moduleNameMapper config option when used with paths.
  • Fixed an error with Jasmine 2 and tests that throw 'string errors'.
  • Fixed issues with unmocking symlinked module names.
  • Fixed mocking of boolean values.
  • Fixed mocking of fields that start with an underscore ("private fields").
  • Fixed unmocking behavior with npm3.
  • Fixed and improved --onlyChanged option.
  • Fixed support for running Jest as a git submodule.
  • Improved verbose logger output
  • Fixed test runtime error reporting and stack traces.
  • Improved toBeCalled Jasmine 2 custom matcher messages.
  • Improved error reporting when a syntax error occurs.
  • Renamed HasteModuleLoader to Runtime.
  • Jest now properly reports pending tests disabled with xit and xdescribe.
  • Removed preprocessCachingDisabled config option.
  • Added a testEnvironment option to customize the sandbox environment.
  • Added support for @scoped/name npm packages.
  • Added an integration test runner for Jest that runs all tests for examples and packages.
cpojer
published 10.0.2 •

cpojer
published 10.0.1 •

cpojer
published 10.0.0 •

cpojer
published 9.0.3 •

Changelog

Source

29.0.3

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)
cpojer
published 1.0.0 •

Changelog

Source

jest 21.0.0

  • Add --changedFilesWithAncestor (#4070)

  • Add --findRelatedFiles (#4131)

  • Add --onlyChanged tests (#3977)

  • Add contextLines option to jest-diff (#4152)

  • Add alternative serialize API for pretty-format plugins (#4114)

  • Add displayName to MPR (#4327)

  • Add displayName to TestResult (#4408)

  • Add es5 build of pretty-format (#4075)

  • Add extra info to no tests for changed files message (#4188)

  • Add fake chalk in browser builds in order to support IE10 (#4367)

  • Add jest.requireActual (#4260)

  • Add maxWorkers to globalConfig (#4005)

  • Add skipped tests support for jest-editor-support (#4346)

  • Add source map support for better debugging experience (#3738)

  • Add support for Error objects in toMatchObject (#4339)

  • Add support for Immutable.Record in pretty-format (#3678)

  • Add tests for extract_requires on export types (#4080)

  • Add that toMatchObject can match arrays (#3994)

  • Add watchPathIgnorePatterns to exclude paths to trigger test re-run in watch mode (#4331)

  • Adding ancestorTitles property to JSON test output (#4293)

  • Allow custom resolver to be used with[out] moduleNameMapper (#4174)

  • Avoid parsing .require(…) method calls (#3777)

  • Avoid unnecessary function declarations and call in pretty-format (#3962)

  • Avoid writing to stdout in default reporter if --json is enabled. Fixes #3941 (#3945)

  • Better error handling for --config (#4230)

  • Call consistent pretty-format plugins within Jest (#3800)

  • Change babel-core to peerDependency for compatibility with Babel 7 (#4162)

  • Change Promise detection code in jest-circus to support non-global Promise implementations (#4375)

  • Changed files eager loading (#3979)

  • Check whether we should output to stdout or stderr (#3953)

  • Clarify what objects toContain and toContainEqual can be used on (#4307)

  • Clean up resolve() logic. Provide useful names for variables and functions. Test that a directory exists before attempting to resolve files within it. (#4325)

  • cleanupStackTrace (#3696)

  • compare objects with Symbol keys (#3437)

  • Complain if expect is passed multiple arguments (#4237)

  • Completes nodeCrawl with empty roots (#3776)

  • Consistent naming of files (#3798)

  • Convert code base to ESM import (#3778)

  • Correct summary message for flag --findRelatedTests. (#4309)

  • Coverage thresholds can be set up for individual files (#4185)

  • custom reporter error handling (#4051)

  • Define separate type for pretty-format plugin Options (#3802)

  • Delete confusing async keyword (#3679)

  • Delete redundant branch in ReactElement and HTMLElement plugins (#3731)

  • Don't format node assert errors when there's no 'assert' module (#4376)

  • Don't print test summary in --silent (#4106)

  • Don't try to build ghost packages (#3934)

  • Escape double quotes in attribute values in HTMLElement plugin (#3797)

  • Explain how to clear the cache (#4232)

  • Factor out common code for collections in pretty-format (#4184)

  • Factor out common code for markup in React plugins (#4171)

  • Feature/internal resolve (#4315)

  • Fix --logHeapUsage (#4176)

  • Fix --showConfig to show all project configs (#4078)

  • Fix --watchAll (#4254)

  • Fix bug when setTimeout is mocked (#3769)

  • Fix changedFilesWithAncestor (#4193)

  • Fix colors for expected/stored snapshot message (#3702)

  • Fix concurrent test failure (#4159)

  • Fix for 4286: Compare Maps and Sets by value rather than order (#4303)

  • fix forceExit (#4105)

  • Fix grammar in React Native docs (#3838)

  • Fix inconsistent name of complex values in pretty-format (#4001)

  • Fix issue mocking bound method (#3805)

  • Fix jest-circus (#4290)

  • Fix lint warning in main

    (#4132)

  • Fix linting (#3946)

  • fix merge conflict (#4144)

  • Fix minor typo (#3729)

  • fix missing console.log messages (#3895)

  • fix mock return value (#3933)

  • Fix mocking for modules with folders on windows (#4238)

  • Fix NODE_PATH resolving for relative paths (#3616)

  • Fix options.moduleNameMapper override order with preset (#3565 (#3689)

  • Fix React PropTypes warning in tests for Immutable plugin (#4412)

  • Fix regression in mockReturnValueOnce (#3857)

  • Fix sample code of mock class constructors (#4115)

  • Fix setup-test-framework-test (#3773)

  • fix typescript jest test crash (#4363)

  • Fix watch mode (#4084)

  • Fix Watchman on windows (#4018)

  • Fix(babel): Handle ignored files in babel v7 (#4393)

  • Fix(babel): Support upcoming beta (#4403)

  • Fixed object matcher (#3799)

  • Fixes #3820 use extractExpectedAssertionsErrors in jasmine setup

  • Flow upgrade (#4355)

  • Force message in matchers to always be a function (#3972)

  • Format describe and use test instead of it alias (#3792)

  • global_config.js for multi-project runner (#4023)

  • Handle async errors (#4016)

  • Hard-fail if hasteImpl is throwing an error during initialization. (#3812)

  • Ignore import type for extract_requires (#4079)

  • Ignore indentation of data structures in jest-diff (#3429)

  • Implement 'jest.requireMock' (#4292)

  • Improve Jest phabricator plugin (#4195)

  • Improve Seq and remove newline from non-min empty in Immutable plugin (#4241)

  • Improved the jest reporter with snapshot info per test. (#3660)

  • Include fullName in formattedAssertion (#4273)

  • Integrated with Yarn workspaces (#3906)

  • jest --all (#4020)

  • jest-circus test failures (#3770)

  • jest-circus Timeouts (#3760)

  • jest-haste-map: add test case for broken handling of ignore pattern (#4047)

  • jest-haste-map: add test+fix for broken platform module support (#3885)

  • jest-haste-map: deprecate functional ignorePattern and use it in cache key (#4063)

  • jest-haste-map: mock 'fs' with more idiomatic jest.mock() (#4046)

  • jest-haste-map: only file IO errors should be silently ignored (#3816)

  • jest-haste-map: throw when trying to get a duplicated module (#3976)

  • jest-haste-map: watchman crawler: normalize paths (#3887)

  • jest-runtime: atomic cache write, and check validity of data (#4088)

  • Join lines with newline in jest-diff (#4314)

  • Keep ARGV only in CLI files (#4012)

  • let transformers adjust cache key based on mapCoverage (#4187)

  • Lift requires (#3780)

  • Log stack when reporting errors in jest-runtime (#3833)

  • Make --listTests return a new line separated list when not using --json (#4229)

  • Make build script printing small-terminals-friendly (#3892)

  • Make error messages more explicit for toBeCalledWith assertions (#3913)

  • Make jest-matcher-utils use ESM exports (#4342)

  • Make jest-runner a standalone package. (#4236)

  • Make Jest’s Test Runner configurable. (#4240)

  • Make listTests always print to console.log (#4391)

  • Make providesModuleNodeModules ignore nested node_modules directories

  • Make sure function mocks match original arity (#4170)

  • Make sure runAllTimers also clears all ticks (#3915)

  • Make toBe matcher error message more helpful for objects and arrays (#4277)

  • Make useRealTimers play well with timers: fake (#3858)

  • Move getType from jest-matcher-utils to separate package (#3559)

  • Multiroot jest-change-files (#3969)

  • Output created snapshot when using --ci option (#3693)

  • Point out you can use matchers in .toMatchObject (#3796)

  • Prevent babelrc package import failure on relative current path (#3723)

  • Print RDP details for windows builds (#4017)

  • Provide better error checking for transformed content (#3807)

  • Provide printText and printComment in markup.js for HTMLElement plugin (#4344)

  • Provide regex visualization for testRegex (#3758)

  • Refactor CLI (#3862)

  • Refactor names and delimiters of complex values in pretty-format (#3986)

  • Replace concat(Immutable) with Immutable as item of plugins array (#4207)

  • Replace Jasmine with jest-circus (#3668)

  • Replace match with test and omit redundant String conversion (#4311)

  • Replace print with serialize in AsymmetricMatcher plugin (#4173)

  • Replace print with serialize in ConvertAnsi plugin (#4225)

  • Replace print with serialize in HTMLElement plugin (#4215)

  • Replace print with serialize in Immutable plugins (#4189)

  • Replace unchanging args with one config arg within pretty-format (#4076)

  • Return UNDEFINED for undefined type in ReactElement plugin (#4360)

  • Rewrite some read bumps in pretty-format (#4093)

  • Run update method before installing JRE on Circle (#4318)

  • Separated the snapshot summary creation from the printing to improve testability. (#4373)

  • Set coverageDirectory during normalize phase (#3966)

  • Setup custom reporters after default reporters (#4053)

  • Setup for Circle 2 (#4149)

  • Simplify readme (#3790)

  • Simplify snapshots definition (#3791)

  • skipNodeResolution config option (#3987)

  • Small fixes to toHaveProperty docs (#3878)

  • Sort attributes by name in HTMLElement plugin (#3783)

  • Specify watchPathIgnorePatterns will only be available in Jest 21+ (#4398)

  • Split TestRunner off of TestScheduler (#4233)

  • Strict and explicit config resolution logic (#4122)

  • Support maxDepth option in React plugins (#4208)

  • Support SVG elements in HTMLElement plugin (#4335)

  • Test empty Immutable collections with {min: false} option (#4121)

  • test to debug travis failure in main (#4145)

  • testPathPattern message test (#4006)

  • Throw Error When Using Nested It Specs (#4039)

  • Throw when moduleNameMapper points to inexistent module (#3567)

  • Unified 'no tests found' message for non-verbose MPR (#4354)

  • Update migration guide with jest-codemods transformers (#4306)

  • Use "inputSourceMap" for coverage re-mapping. (#4009)

  • Use "verbose" no test found message when there is only one project (#4378)

  • Use babel transform to inline all requires (#4340)

  • Use eslint plugins to run prettier (#3971)

  • Use iterableEquality in spy matchers (#3651)

  • Use modern HTML5 <!DOCTYPE> (#3937)

  • Wrap Error.captureStackTrace in a try (#4035)

cpojer
published 0.0.0 •

Changelog

Source

jest 20.0.0

  • New --projects option to run one instance of Jest in multiple projects at the same time. (#3400)
  • New multi project runner (#3156)
  • New --listTests flag. (#3441)
  • New --showConfig flag. (#3296)
  • New promise support for all expect matchers through .resolves and .rejects. (#3068)
  • New expect.hasAssertions() function similar to expect.assertions(). (#3379)
  • New this.equals function exposed to custom matchers. (#3469)
  • New valid-expect lint rule in eslint-plugin-jest. (#3067)
  • New HtmlElement pretty-format plugin. (#3230)
  • New Immutable pretty-format plugins. (#2899)
  • New test environment per file setting through @jest-environment in the docblock. (#2859)
  • New feature that allows every configuration option to be set from the command line. (#3424)
  • New feature to add custom reporters to Jest through reporters in the configuration. (#3349)
  • New feature to add expected and actual values to AssertionError. (#3217)
  • New feature to map code coverage from transformers. (#2290)
  • New feature to run untested code coverage in parallel. (#3407)
  • New option to define a custom resolver. (#2998)
  • New printing support for text and comment nodes in html pretty-format. (#3355)
  • New snapshot testing FAQ (#3425)
  • New support for custom platforms on jest-haste-map. (#3162)
  • New support for mocking native async methods. (#3209)
  • New guide on how to use Jest with any JavaScript framework. (#3243)
  • New translation system for the Jest website.
  • New collapsing watch mode usage prompt after first run. (#3078)
  • Breaking Change: Forked Jasmine 2.5 into Jest's own test runner and rewrote large parts of Jasmine. (#3147)
  • Breaking Change: Jest does not write new snapshots by default on CI. (#3456)
  • Breaking Change: Moved the typescript parser from jest-editor-support into a separate jest-test-typescript-parser package. (#2973)
  • Breaking Change: Replaced auto-loading of babel-polyfill with only regenerator-runtime, fixes a major memory leak. (#2755)
  • Fixed babel-jest to look up the babel field in package.json as a fallback.
  • Fixed jest-editor-support's parser to not crash on incomplete ASTs. (#3259)
  • Fixed jest-resolve to use is-builtin-module instead of resolve.isCore. (#2997)
  • Fixed jest-snapshot to normalize line endings in the serialize function. (#3002)
  • Fixed behavior of --silent flag. (#3003)
  • Fixed bug with watchers on macOS causing test to crash. (#2957)
  • Fixed CLI notify option not taking precedence over config option. (#3340)
  • Fixed detection of the npm client in SummaryReporter to support Yarn. (#3263)
  • Fixed done.fail not passing arguments (#3241)
  • Fixed fake timers to restore after resetting mocks. (#2467)
  • Fixed handling of babylon's parser options in jest-editor-support. (#3344)
  • Fixed Jest to properly cache transform results. (#3334)
  • Fixed Jest to use human-readable colors for Jest's own snapshots. (#3119)
  • Fixed jest-config to use UID for default cache folder. (#3380), (#3387)
  • Fixed jest-runtime to expose inner error when it fails to write to the cache. (#3373)
  • Fixed lifecycle hooks to make afterAll hooks operate the same as afterEach. (#3275)
  • Fixed pretty-format to run plugins before serializing nested basic values. (#3017)
  • Fixed return value of mocks so they can explicitly be set to return undefined. (#3354)
  • Fixed runner to run tests associated with snapshots when the snapshot changes. (#3025)
  • Fixed snapshot serializer require, restructured pretty-format. (#3399)
  • Fixed support for Babel 7 in babel-jest. (#3271)
  • Fixed testMatch to find tests in .folders. (#3006)
  • Fixed testNamePattern and testPathPattern to work better together. (#3327)
  • Fixed to show reject reason when expecting resolve. (#3134)
  • Fixed toHaveProperty() to use hasOwnProperty from Object (#3410)
  • Fixed watch mode's screen clearing. (#2959) (#3294)
  • Improved and consolidated Jest's configuration file resolution. (#3472)
  • Improved documentation throughout the Jest website.
  • Improved documentation to explicitly mention that snapshots must be reviewed. (#3203)
  • Improved documentation to make it clear CRA users don't need to add dependencies. (#3312)
  • Improved eslint-plugin-jest's handling of expect. (#3306)
  • Improved flow-coverage, eslint rules and test coverage within the Jest repository.
  • Improved printing of expect.assertions error. (#3033)
  • Improved Windows test coverage of Jest.
  • Refactored configs & transform (#3376)
  • Refactored reporters to pass individual Tests to reporters. (#3289)
  • Refactored TestRunner (#3166)
  • Refactored watch mode prompts. (#3290)
  • Deleted jest-file-exists. (#3105)
  • Removed Config type. (#3366)
  • Removed all usage of jest-file-exists. (#3101)
  • Adopted prettier on the Jest codebase.
1
2223
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc