Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jestjs/jest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b16789230fd45056a7f2fa199bae06c7a1780deb
Choose a base ref
...
head repository: jestjs/jest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: be16e47afcc9f64653b9a47782cb48a5ca243e65
Choose a head ref
Loading
Showing 2,674 changed files with 187,629 additions and 126,644 deletions.
33 changes: 17 additions & 16 deletions .azure-pipelines-steps.yml
Original file line number Diff line number Diff line change
@@ -2,44 +2,45 @@
# Steps for building and testing Jest. See jobs defined in .azure-pipelines.yml
#

# Clones the repo
steps:
- checkout: self
path: jest

# Ensure Node.js 10 is active
# Ensure Node.js 14 is active
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Use Node.js 10'
versionSpec: '14.x'
displayName: 'Use Node.js 14'

# Ensure Python 2.7 is active
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7'
displayName: 'Use Python 2.7'

# Workaround to move source files under a "jest" folder (see .azure-pipelines.yml for details)
- script: |
cd /
mv $(Build.Repository.LocalPath) $(JEST_DIR)
mkdir $(Build.Repository.LocalPath)
displayName: 'Move source into jest folder'
- bash: echo "##vso[task.setvariable variable=folder;isOutput=true]$(yarn config get cacheFolder)"
name: yarnCache

# Run yarn to install dependencies and build
- script: yarn --frozen-lockfile
workingDirectory: $(JEST_DIR)
displayName: 'Install dependencies and build'
- task: Cache@2
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(yarnCache.folder)
displayName: Cache Yarn packages

- script: yarn install --immutable
displayName: 'Install dependencies'

- script: yarn build:js
displayName: 'Transpile TypeScript'

# Run test-ci-partial
- script: yarn run test-ci-partial
workingDirectory: $(JEST_DIR)
displayName: 'Run tests'

# Publish CI test results
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/reports/junit/*.xml'
searchFolder: $(JEST_DIR)
testRunTitle: 'CI Tests $(Agent.OS)'
displayName: 'Publish test results'
condition: succeededOrFailed()
6 changes: 1 addition & 5 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:

- job: macOS
pool:
vmImage: macos-10.13
vmImage: macos-10.15
steps:
# This step can be removed once Mercurial gets installed on the macOS image. See https://github.com/Microsoft/azure-pipelines-image-generation/issues/604
- script: HOMEBREW_NO_AUTO_UPDATE=1 brew install mercurial
@@ -32,9 +32,5 @@ variables:
# Used by chalk. Ensures output from Jest includes ANSI escape characters that are needed to match test snapshots.
FORCE_COLOR: 1

# By default, Azure Pipelines clones to an "s" directory, which causes tests to fail due to assumption of Jest being run from a "jest" directory.
# See packages/jest-message-util/src/index.js PATH_JEST_PACKAGES for more details.
JEST_DIR: $(Agent.BuildDirectory)/jest

# Ensures the handful of tests that should be skipped during CI are
CI: true
171 changes: 51 additions & 120 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,143 +1,74 @@
aliases:
- &restore-cache
keys:
- v2-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }}
# Fallback in case checksum fails
- v2-dependencies-{{ .Branch }}-

- &save-cache
paths:
- node_modules
- website/node_modules
key: v2-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }}
version: 2.1

aliases:
- &filter-ignore-gh-pages
branches:
ignore: gh-pages
- &install
pkg-manager: yarn
override-ci-command: yarn install --immutable && yarn build:js
cache-path: ~/.yarn/berry/cache
include-branch-in-cache-key: false
app-dir: ~/jest

version: 2
jobs:
lint-and-typecheck:
working_directory: ~/jest
docker:
- image: circleci/node:10
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run: echo server.max_workers=1 >> .flowconfig
- run: yarn lint --format junit -o reports/junit/js-lint-results.xml && yarn typecheck && yarn lint-es5-build --format junit -o reports/junit/js-es5-lint-results.xml && yarn lint:md:ci && yarn check-copyright-headers
- store_test_results:
path: reports/junit
orbs:
node: circleci/node@4.0.0

test-node-6:
working_directory: ~/jest
docker:
- image: circleci/node:6
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile --ignore-engines
- save-cache: *save-cache
- run:
# react-native does not work with node 6
command: rm -rf examples/react-native && yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-8:
working_directory: ~/jest
docker:
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-10:
working_directory: ~/jest
docker:
- image: circleci/node:10
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
command: yarn test-ci
- store_test_results:
path: reports/junit

test-jest-circus:
jobs:
test-node:
parameters:
node-version:
type: string
partial:
type: boolean
default: false
working_directory: ~/jest
docker:
- image: circleci/node:10
executor: node/default
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
command: JEST_CIRCUS=1 yarn test-ci-partial
- node/install:
node-version: << parameters.node-version >>
install-npm: false
- node/install-packages: *install
- when:
condition: << parameters.partial >>
steps:
- run:
command: yarn test-ci-partial
- unless:
condition: << parameters.partial >>
steps:
- run:
command: yarn test-ci
- store_test_results:
path: reports/junit

test-node-11:
test-jest-jasmine:
working_directory: ~/jest
docker:
- image: circleci/node:11
executor: node/default
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- node/install:
lts: true
install-npm: false
- node/install-packages: *install
- run:
command: yarn test-ci-partial
command: JEST_JASMINE=1 yarn test-ci-partial && JEST_JASMINE=1 yarn test-leak
- store_test_results:
path: reports/junit

test-browser:
working_directory: ~/jest
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run: yarn test-ci-es5-build-in-browser

test-or-deploy-website:
working_directory: ~/jest
docker:
- image: circleci/node:10
resource_class: large
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
name: Test or Deploy Jest Website
command: ./.circleci/website.sh

# Workflows enables us to run multiple jobs in parallel
workflows:
version: 2
build-and-deploy:
jobs:
- lint-and-typecheck
- test-node-6
- test-node-8
- test-node-10
- test-jest-circus
- test-node-11 # current
- test-browser
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
- test-node:
matrix:
parameters:
node-version: ['14']
- test-node:
name: test-node-partial-<< matrix.node-version >>
partial: true
matrix:
parameters:
node-version: ['10', '12', '15', '16']
- test-jest-jasmine
31 changes: 0 additions & 31 deletions .circleci/website.sh

This file was deleted.

10 changes: 9 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
#
# Some of these options are also respected by Prettier

root = true

[*]
indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.md,*.snap}]
[*.{md,snap}]
trim_trailing_whitespace = false
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -3,10 +3,11 @@
bin/
flow-typed/**
packages/*/build/**
packages/*/build-es5/**
packages/jest-diff/src/cleanupSemantic.ts
website/.docusaurus
website/blog
website/build
website/node_modules
website/i18n/*.js
website/translated_docs
website/static
!.eslintrc.js
14 changes: 14 additions & 0 deletions .eslintplugin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

exports.rules = {
'ban-types-eventually': require('@typescript-eslint/eslint-plugin').rules[
'ban-types'
],
'prefer-rest-params-eventually': require('eslint/lib/rules/prefer-rest-params'),
'prefer-spread-eventually': require('eslint/lib/rules/prefer-spread'),
};
Loading