Skip to content

Commit 1b10dc8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into uglier-inline-snapshots
* upstream/master: (225 commits) docs: add CLA link to contributing docs (jestjs#9789) chore: roll new version of docs v25.3.0 chore: update changelog for release chore(jest-types): correct type testRegex for ProjectConfig (jestjs#9780) feat(circus): enable writing async test event handlers (jestjs#9397) feat: enable all babel syntax plugins (jestjs#9774) chore: add helper for getting Jest's config in e2e tests (jestjs#9770) feat: pass ESM options to transformers (jestjs#9597) chore: replace `any`s with `unknown`s (jestjs#9626) feat: pass ESM options to Babel (jestjs#9766) chore(website): add copy button the code blocks (jestjs#9750) chore: bump istanbul-reports for new uncovered lines design (jestjs#9758) chore: correct CHANGELOG.md (jestjs#9763) chore(jest-types): expose type `CacheKeyOptions` for `getCacheK… (jestjs#9762) docs: Fix simple typo, seperated -> separated (jestjs#9760) v25.2.7 chore: update changelog for release fix: drop getters and setters when diffing objects for error (jestjs#9757) chore(jest-types): correct return type of shouldRunTestSuite fo… (jestjs#9753) ...
2 parents 2bc8090 + 4caa7b5 commit 1b10dc8

File tree

819 files changed

+19538
-14873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

819 files changed

+19538
-14873
lines changed

.azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- job: macOS
2323
pool:
24-
vmImage: macos-10.13
24+
vmImage: macos-10.15
2525
steps:
2626
# This step can be removed once Mercurial gets installed on the macOS image. See https://github.com/Microsoft/azure-pipelines-image-generation/issues/604
2727
- script: HOMEBREW_NO_AUTO_UPDATE=1 brew install mercurial

.circleci/config.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,14 @@ aliases:
1818

1919
version: 2
2020
jobs:
21-
lint-and-typecheck:
22-
working_directory: ~/jest
23-
docker:
24-
- image: circleci/node:12
25-
steps:
26-
- checkout
27-
- restore-cache: *restore-cache
28-
- run: yarn --no-progress --frozen-lockfile
29-
- save-cache: *save-cache
30-
- 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
31-
- store_test_results:
32-
path: reports/junit
33-
3421
test-node-8:
3522
working_directory: ~/jest
3623
docker:
3724
- image: circleci/node:8
3825
steps:
3926
- checkout
27+
- run:
28+
command: yarn remove-prettier-dep
4029
- restore-cache: *restore-cache
4130
- run: *install
4231
- save-cache: *save-cache
@@ -131,7 +120,6 @@ workflows:
131120
version: 2
132121
build-and-deploy:
133122
jobs:
134-
- lint-and-typecheck
135123
- test-node-8
136124
- test-node-10
137125
- test-node-12

.circleci/website.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
git diff-tree --no-commit-id --name-only -r HEAD > files_changed.txt
6-
if ! grep -E "(^docs\/.*)|(^website\/.*)" files_changed.txt; then
6+
if ! grep -E "(^docs\/.*)|(^website\/.*)|(^\.circleci/website\.sh$)" files_changed.txt; then
77
echo "Skipping deploy & test. No relevant website files have changed"
88
else
99
echo "Relevant website files have changed"
@@ -13,7 +13,7 @@ else
1313
git config --global user.name "Website Deployment Script"
1414
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
1515
# install Docusaurus and generate file of English strings
16-
yarn && cd website && yarn write-translations
16+
yarn && cd website && node fetchSupporters.js && yarn write-translations
1717
# crowdin install
1818
sudo apt-get update
1919
sudo apt-get install default-jre rsync
@@ -30,6 +30,6 @@ else
3030
GIT_USER=docusaurus-bot USE_SSH=false yarn publish-gh-pages
3131
else
3232
echo "Skipping deploy. Test website build"
33-
cd website && yarn && yarn build
33+
cd website && yarn && node fetchSupporters.js && yarn build
3434
fi
3535
fi

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ website/build
1010
website/node_modules
1111
website/i18n/*.js
1212
website/translated_docs
13+
website/static
1314
!.eslintrc.js

.eslintrc.js

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
'plugin:import/typescript',
1313
'prettier',
1414
'prettier/flowtype',
15+
'plugin:eslint-comments/recommended',
1516
],
1617
overrides: [
1718
{
@@ -67,11 +68,41 @@ module.exports = {
6768
},
6869
},
6970
{
70-
files: ['packages/jest-types/**/*'],
71+
files: 'packages/jest-types/**/*',
7172
rules: {
7273
'import/no-extraneous-dependencies': 0,
7374
},
7475
},
76+
{
77+
files: 'packages/**/*.ts',
78+
rules: {
79+
'@typescript-eslint/explicit-module-boundary-types': 2,
80+
},
81+
},
82+
{
83+
files: [
84+
'**/__tests__/**',
85+
'**/__mocks__/**',
86+
'packages/jest-jasmine2/src/jasmine/**/*',
87+
'packages/expect/src/jasmineUtils.ts',
88+
'**/vendor/**/*',
89+
],
90+
rules: {
91+
'@typescript-eslint/explicit-module-boundary-types': 0,
92+
},
93+
},
94+
{
95+
files: [
96+
'packages/jest-jasmine2/src/jasmine/**/*',
97+
'packages/expect/src/jasmineUtils.ts',
98+
'e2e/browser-support/browserTest.js',
99+
'**/vendor/**/*',
100+
],
101+
rules: {
102+
'eslint-comments/disable-enable-pair': 0,
103+
'eslint-comments/no-unlimited-disable': 0,
104+
},
105+
},
75106
{
76107
files: [
77108
'website/**',
@@ -85,9 +116,10 @@ module.exports = {
85116
},
86117
],
87118
parser: 'babel-eslint',
88-
plugins: ['markdown', 'import', 'prettier'],
119+
plugins: ['markdown', 'import', 'prettier', 'eslint-comments'],
89120
rules: {
90121
'arrow-body-style': 2,
122+
'eslint-comments/no-unused-disable': 2,
91123
'flowtype/boolean-style': 2,
92124
'flowtype/no-primitive-constructor-types': 2,
93125
'flowtype/require-valid-file-annotation': 2,

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Run npx envinfo --preset jest
3232
Paste the results here:
3333
-->
3434

35-
```bash
35+
```
3636
3737
```

.github/ISSUE_TEMPLATE/regression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ Issues without a reproduction link are likely to stall.
3434

3535
Paste the results here:
3636

37-
```bash
37+
```
3838
3939
```

.github/workflows/nodejs.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
cleanup-runs:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: rokroskar/workflow-run-cleanup-action@master
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
19+
20+
lint-and-typecheck:
21+
name: Running TypeScript compiler & ESLint
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Get yarn cache
27+
id: yarn-cache
28+
run: echo "::set-output name=dir::$(yarn cache dir)"
29+
- uses: actions/cache@v1
30+
with:
31+
path: ${{ steps.yarn-cache.outputs.dir }}
32+
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
ubuntu-latest-node-12.x-yarn-
35+
- uses: actions/setup-node@v1
36+
with:
37+
node-version: 12.x
38+
- name: install
39+
run: yarn install-no-ts-build
40+
- name: build
41+
run: node scripts/build.js
42+
- name: run tsc
43+
run: yarn build:ts
44+
- name: verify ts 3.4 compatibility
45+
run: yarn verify-old-ts
46+
- name: run eslint
47+
run: yarn lint
48+
- name: run eslint on browser builds
49+
run: yarn lint-es5-build
50+
- name: run prettier
51+
run: yarn lint:prettier:ci
52+
- name: check copyright headers
53+
run: yarn check-copyright-headers
54+
test:
55+
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
# https://github.com/actions/setup-node/issues/27
60+
node-version: [8.17.0, 10.x, 12.x, 13.x]
61+
os: [ubuntu-latest, macOS-latest, windows-latest]
62+
runs-on: ${{ matrix.os }}
63+
64+
steps:
65+
- name: Set git config
66+
shell: bash
67+
run: |
68+
git config --global core.autocrlf false
69+
git config --global core.symlinks true
70+
if: runner.os == 'Windows'
71+
- uses: actions/checkout@v2
72+
- name: Get yarn cache
73+
id: yarn-cache
74+
run: echo "::set-output name=dir::$(yarn cache dir)"
75+
- uses: actions/cache@v1
76+
with:
77+
path: ${{ steps.yarn-cache.outputs.dir }}
78+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
79+
restore-keys: |
80+
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
81+
- name: Use Node.js ${{ matrix.node-version }}
82+
uses: actions/setup-node@v1
83+
with:
84+
node-version: ${{ matrix.node-version }}
85+
- name: remove prettier dep
86+
run: yarn remove-prettier-dep
87+
if: matrix.node-version == '8.17.0'
88+
- name: install
89+
run: yarn install-no-ts-build
90+
- name: run tests
91+
run: yarn test-ci-partial
92+
env:
93+
CI: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.swp
55
*~
66
/examples/*/node_modules/
7+
/examples/mongodb/globalConfig.json
78

89
/e2e/*/node_modules
910
/e2e/*/.pnp

.vscode/settings.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
"**/node_modules": true,
66
"**/build": true
77
},
8-
"editor.formatOnSave": true,
9-
"flow.useNPMPackagedFlow": true,
108
"javascript.validate.enable": false,
119
"jest.pathToJest": "yarn jest --",
12-
"prettier.eslintIntegration": true,
13-
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false
10+
"editor.codeActionsOnSave": {
11+
"source.fixAll.eslint": true
12+
}
1413
}

0 commit comments

Comments
 (0)