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: 9ad0f4bc6b8bdd94989804226c28c9960d9da7d1
Choose a base ref
...
head repository: jestjs/jest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 170eee11d03b0ed5c60077982fdbc3bafd403638
Choose a head ref
Loading
Showing 841 changed files with 31,123 additions and 18,564 deletions.
15 changes: 9 additions & 6 deletions .azure-pipelines-steps.yml
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ steps:
# Ensure Node.js 10 is active
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Use Node.js 10'
versionSpec: '12.x'
displayName: 'Use Node.js 12'

# Ensure Python 2.7 is active
- task: UsePythonVersion@0
@@ -22,11 +22,14 @@ steps:
- script: node scripts/remove-postinstall
displayName: 'Remove postinstall script'

- script: yarn --no-progress --frozen-lockfile
displayName: 'Install dependencies'
- task: CacheBeta@0
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages

- script: node scripts/build
displayName: 'Build'
- script: yarn install-no-ts-build
displayName: 'Install dependencies'

# Run test-ci-partial
- script: yarn run test-ci-partial
2 changes: 2 additions & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -34,3 +34,5 @@ variables:

# Ensures the handful of tests that should be skipped during CI are
CI: true

YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
51 changes: 18 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -14,42 +14,28 @@ aliases:
- &filter-ignore-gh-pages
branches:
ignore: gh-pages
- &install node scripts/remove-postinstall && yarn --no-progress --frozen-lockfile --ignore-engines && node scripts/build
- &install yarn install-no-ts-build

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: yarn lint --format junit -o reports/junit/js-lint-results.xml && yarn lint-es5-build --format junit -o reports/junit/js-es5-lint-results.xml && yarn lint:prettier:ci && yarn check-copyright-headers
- store_test_results:
path: reports/junit

test-node-6:
test-node-8:
working_directory: ~/jest
docker:
- image: circleci/node:6
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
# react-native and react-testing-library do not work with node 6
command: rm -rf examples/react-native examples/react-testing-library && yarn test-ci-partial
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-8:
test-node-10:
working_directory: ~/jest
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- checkout
- restore-cache: *restore-cache
@@ -60,38 +46,38 @@ jobs:
- store_test_results:
path: reports/junit

test-node-10:
test-jest-circus:
working_directory: ~/jest
docker:
- image: circleci/node:10
- image: circleci/node:12
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
command: yarn test-ci
command: JEST_CIRCUS=1 yarn test-ci-partial
- store_test_results:
path: reports/junit

test-jest-circus:
test-node-12:
working_directory: ~/jest
docker:
- image: circleci/node:10
- image: circleci/node:12
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
command: JEST_CIRCUS=1 yarn test-ci-partial
command: yarn test-ci
- store_test_results:
path: reports/junit

test-node-11:
test-node-13:
working_directory: ~/jest
docker:
- image: circleci/node:11
- image: circleci/node:13
steps:
- checkout
- restore-cache: *restore-cache
@@ -105,7 +91,7 @@ jobs:
test-browser:
working_directory: ~/jest
docker:
- image: circleci/node:10-browsers
- image: circleci/node:12-browsers
steps:
- checkout
- restore-cache: *restore-cache
@@ -116,7 +102,7 @@ jobs:
test-or-deploy-website:
working_directory: ~/jest
docker:
- image: circleci/node:10
- image: circleci/node:12
resource_class: large
steps:
- checkout
@@ -132,12 +118,11 @@ workflows:
version: 2
build-and-deploy:
jobs:
- lint-and-typecheck
- test-node-6
- test-node-8
- test-node-10
- test-node-12
- test-node-13 # current
- test-jest-circus
- test-node-11 # current
- test-browser
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
6 changes: 3 additions & 3 deletions .circleci/website.sh
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
set -e

git diff-tree --no-commit-id --name-only -r HEAD > files_changed.txt
if ! grep -E "(^docs\/.*)|(^website\/.*)" files_changed.txt; then
if ! grep -E "(^docs\/.*)|(^website\/.*)|(^\.circleci/website\.sh$)" files_changed.txt; then
echo "Skipping deploy & test. No relevant website files have changed"
else
echo "Relevant website files have changed"
@@ -13,7 +13,7 @@ else
git config --global user.name "Website Deployment Script"
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
# install Docusaurus and generate file of English strings
yarn && cd website && yarn write-translations
yarn && cd website && node fetchSupporters.js && yarn write-translations
# crowdin install
sudo apt-get update
sudo apt-get install default-jre rsync
@@ -30,6 +30,6 @@ else
GIT_USER=docusaurus-bot USE_SSH=false yarn publish-gh-pages
else
echo "Skipping deploy. Test website build"
cd website && yarn && yarn build
cd website && yarn && node fetchSupporters.js && yarn build
fi
fi
30 changes: 22 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -9,21 +9,25 @@ module.exports = {
extends: [
'./packages/eslint-config-fb-strict/index.js',
'plugin:import/errors',
'plugin:import/typescript',
'prettier',
'prettier/flowtype',
'plugin:eslint-comments/recommended',
],
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
'@typescript-eslint/array-type': ['error', 'generic'],
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'},
],
// Since we do `export =`. Remove for Jest 25
'import/default': 'off',
'import/order': 'error',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
@@ -64,11 +68,23 @@ module.exports = {
},
},
{
files: ['packages/jest-types/**/*'],
files: 'packages/jest-types/**/*',
rules: {
'import/no-extraneous-dependencies': 0,
},
},
{
files: [
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'e2e/browser-support/browserTest.js',
'**/vendor/**/*',
],
rules: {
'eslint-comments/disable-enable-pair': 0,
'eslint-comments/no-unlimited-disable': 0,
},
},
{
files: [
'website/**',
@@ -82,9 +98,10 @@ module.exports = {
},
],
parser: 'babel-eslint',
plugins: ['markdown', 'import', 'prettier'],
plugins: ['markdown', 'import', 'prettier', 'eslint-comments'],
rules: {
'arrow-body-style': 2,
'eslint-comments/no-unused-disable': 2,
'flowtype/boolean-style': 2,
'flowtype/no-primitive-constructor-types': 2,
'flowtype/require-valid-file-annotation': 2,
@@ -102,16 +119,13 @@ module.exports = {
],
},
],
'import/no-unresolved': [2, {ignore: ['fsevents']}],
// This has to be disabled until all type and module imports are combined
// https://github.com/benmosher/eslint-plugin-import/issues/645
'import/order': 0,
'no-console': 0,
'no-unused-vars': 2,
'prettier/prettier': 2,
},
settings: {
'import/resolver': {
'eslint-import-resolver-typescript': true,
},
'sort-imports': [2, {ignoreDeclarationSort: true}],
},
};
12 changes: 8 additions & 4 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -8,25 +8,29 @@ about: Create a report to help us improve

## 🐛 Bug Report

A clear and concise description of what the bug is.
<!-- A clear and concise description of what the bug is. -->

## To Reproduce

Steps to reproduce the behavior:

## Expected behavior

A clear and concise description of what you expected to happen.
<!-- A clear and concise description of what you expected to happen. -->

## Link to repl or repo (highly encouraged)

<!--
Please provide either a [repl.it demo](https://repl.it/languages/jest) or a minimal repository on GitHub.

Issues without a reproduction link are likely to stall.
-->

## Run `npx envinfo --preset jest`
## envinfo

<!--
Run npx envinfo --preset jest
Paste the results here:
-->

```bash

43 changes: 43 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Node CI

on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
lint-and-typecheck:
name: Running TypeScript compiler & ESLint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
ubuntu-latest-node-12.x-yarn-
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: install
run: yarn install-no-ts-build
- name: build
run: node scripts/build.js
- name: run tsc
run: yarn build:ts
- name: run eslint
run: yarn lint
- name: run eslint on browser builds
run: yarn lint-es5-build
- name: run prettier
run: yarn lint:prettier:ci
- name: check copyright headers
run: yarn check-copyright-headers
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- '10'
- 'lts/*'

branches:
only:
@@ -11,7 +11,7 @@ before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"

install: node scripts/remove-postinstall && yarn --no-progress --frozen-lockfile --ignore-engines && node scripts/build
install: yarn install-no-ts-build

cache:
yarn: true
6 changes: 2 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -5,9 +5,7 @@
"**/node_modules": true,
"**/build": true
},
"editor.formatOnSave": true,
"flow.useNPMPackagedFlow": true,
"eslint.autoFixOnSave": true,
"javascript.validate.enable": false,
"jest.pathToJest": "yarn jest --",
"prettier.eslintIntegration": true
"jest.pathToJest": "yarn jest --"
}
Loading