Socket
Socket
Sign inDemoInstall

jest-changed-files

Package Overview
Dependencies
0
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jest-changed-files


Version published
Weekly downloads
22M
decreased by-0.56%
Maintainers
1
Created
Weekly downloads
 

Package description

What is jest-changed-files?

The jest-changed-files npm package is a utility that allows you to determine which files have changed in a git or hg (Mercurial) repository. It is often used in testing environments, particularly with Jest, to identify which tests need to be run based on the changes made to the codebase.

What are jest-changed-files's main functionalities?

Getting changed files from a Git repository

This feature allows you to get a list of files that have changed since the last commit in a Git repository. The 'lastCommit' option specifies that only changes from the last commit should be considered.

const { getChangedFilesForRoots } = require('jest-changed-files');

(async () => {
  const changedFiles = await getChangedFilesForRoots(['./'], { lastCommit: true });
  console.log(changedFiles.changedFiles);
})();

Getting changed files from a Mercurial repository

This feature is similar to the previous one but is used for Mercurial repositories. The 'withAncestor' option can be used to find changes that have occurred since the last common ancestor of the current head and the default branch.

const { getChangedFilesForRoots } = require('jest-changed-files');

(async () => {
  const changedFiles = await getChangedFilesForRoots(['./'], { withAncestor: true });
  console.log(changedFiles.changedFiles);
})();

Other packages similar to jest-changed-files

Changelog

Source

jest 13.0.0

  • Added duration of individual tests in verbose mode.
  • Added a browser config option to properly resolve npm packages with a browser field in package.json if you are writing tests for client side apps
  • Added jest-repl.
  • Split up jest-cli into jest-runtime and jest-config.
  • Added a notification plugin that shows a test run notification using --notify.
  • Refactored TestRunner into SearchSource and improved the "no tests found" message.
  • Added jest.isMockFunction(jest.fn()) to test for mock functions.
  • Improved test reporter printing and added a test failure summary when running many tests.
    • Add support for property testing via testcheck-js.
  • Added a webpack tutorial.
  • Added support for virtual mocks through jest.mock('Module', implementation, {virtual: true}).
  • Added snapshot functionality through toMatchSnapshot().
  • Redesigned website.

FAQs

Last updated on 22 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc