Skip to content

Commit 9d39e68

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pr/7167
* upstream/master: (391 commits) more precise circus asyncError types (jestjs#8150) Add typeahead watch plugin (jestjs#6449) fix: getTimerCount not taking immediates and ticks into account (jestjs#8139) website: add an additional filter predicate to backers (jestjs#7286) [πŸ”₯] Revised README (jestjs#8076) [jest-each] Fix test function type (jestjs#8145) chore: improve bug template labels for easier maintenance (jestjs#8141) Add documentation related to auto-mocking (jestjs#8099) Add support for bigint to pretty-format (jestjs#8138) Revert "Add fuzzing based tests in Jest (jestjs#8012)" chore: remove console.log chore: Improve description of optional arguments in ExpectAPI.md (jestjs#8126) Add fuzzing based tests in Jest (jestjs#8012) Move @types/node to the root package.json (jestjs#8129) chore: use property initializer syntax (jestjs#8117) chore: delete flow types from the repo (jestjs#8061) Move changelog entry to the proper version (jestjs#8115) Release 24.5.0 Expose throwOnModuleCollision (jestjs#8113) add matchers to expect type (jestjs#8093) ...
2 parents 05d39b4 + 8cec4cd commit 9d39e68

File tree

2,424 files changed

+249505
-132242
lines changed

Some content is hidden

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

2,424 files changed

+249505
-132242
lines changed

β€Ž.azure-pipelines-steps.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Steps for building and testing Jest. See jobs defined in .azure-pipelines.yml
3+
#
4+
5+
# Clones the repo
6+
steps:
7+
- checkout: self
8+
9+
# Ensure Node.js 10 is active
10+
- task: NodeTool@0
11+
inputs:
12+
versionSpec: '10.x'
13+
displayName: 'Use Node.js 10'
14+
15+
# Ensure Python 2.7 is active
16+
- task: UsePythonVersion@0
17+
inputs:
18+
versionSpec: '2.7'
19+
displayName: 'Use Python 2.7'
20+
21+
# Workaround to move source files under a "jest" folder (see .azure-pipelines.yml for details)
22+
- script: |
23+
cd /
24+
mv $(Build.Repository.LocalPath) $(JEST_DIR)
25+
mkdir $(Build.Repository.LocalPath)
26+
displayName: 'Move source into jest folder'
27+
28+
# Run yarn to install dependencies and build
29+
- script: yarn --frozen-lockfile
30+
workingDirectory: $(JEST_DIR)
31+
displayName: 'Install dependencies and build'
32+
33+
# Run test-ci-partial
34+
- script: yarn run test-ci-partial
35+
workingDirectory: $(JEST_DIR)
36+
displayName: 'Run tests'
37+
38+
# Publish CI test results
39+
- task: PublishTestResults@2
40+
inputs:
41+
testResultsFiles: '**/reports/junit/*.xml'
42+
searchFolder: $(JEST_DIR)
43+
testRunTitle: 'CI Tests $(Agent.OS)'
44+
displayName: 'Publish test results'
45+
condition: succeededOrFailed()

β€Ž.azure-pipelines.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Azure Pipelines configuration for building and testing Jest on Linux, Windows, and macOS.
3+
#
4+
5+
jobs:
6+
- job: Linux
7+
pool:
8+
vmImage: ubuntu-16.04
9+
steps:
10+
- template: .azure-pipelines-steps.yml
11+
12+
- job: Windows
13+
pool:
14+
vmImage: vs2017-win2016
15+
steps:
16+
- script: |
17+
git config --global core.autocrlf false
18+
git config --global core.symlinks true
19+
displayName: 'Preserve LF endings and symbolic links on check out'
20+
- template: .azure-pipelines-steps.yml
21+
22+
- job: macOS
23+
pool:
24+
vmImage: macos-10.13
25+
steps:
26+
# This step can be removed once Mercurial gets installed on the macOS image. See https://github.com/Microsoft/azure-pipelines-image-generation/issues/604
27+
- script: HOMEBREW_NO_AUTO_UPDATE=1 brew install mercurial
28+
displayName: 'Install Mercurial'
29+
- template: .azure-pipelines-steps.yml
30+
31+
variables:
32+
# Used by chalk. Ensures output from Jest includes ANSI escape characters that are needed to match test snapshots.
33+
FORCE_COLOR: 1
34+
35+
# 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.
36+
# See packages/jest-message-util/src/index.js PATH_JEST_PACKAGES for more details.
37+
JEST_DIR: $(Agent.BuildDirectory)/jest
38+
39+
# Ensures the handful of tests that should be skipped during CI are
40+
CI: true

β€Ž.babelrc

-13
This file was deleted.

β€Ž.circleci/config.yml

+40-24
Original file line numberDiff line numberDiff line change
@@ -24,89 +24,104 @@ jobs:
2424
steps:
2525
- checkout
2626
- restore-cache: *restore-cache
27-
- run: yarn --no-progress
27+
- run: yarn --no-progress --frozen-lockfile
2828
- save-cache: *save-cache
29-
- 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
29+
- run: echo server.max_workers=1 >> .flowconfig
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:md:ci && yarn check-copyright-headers
3031
- store_test_results:
3132
path: reports/junit
3233

33-
test-browser:
34+
test-node-6:
3435
working_directory: ~/jest
3536
docker:
36-
- image: circleci/node:8-browsers
37+
- image: circleci/node:6
3738
steps:
3839
- checkout
3940
- restore-cache: *restore-cache
40-
- run: yarn --no-progress
41+
- run: yarn --no-progress --frozen-lockfile --ignore-engines
4142
- save-cache: *save-cache
42-
- run: yarn test-ci-es5-build-in-browser
43+
- run:
44+
# react-native does not work with node 6
45+
command: rm -rf examples/react-native && yarn test-ci-partial
46+
- store_test_results:
47+
path: reports/junit
4348

44-
test-node-10:
49+
test-node-8:
4550
working_directory: ~/jest
4651
docker:
47-
- image: circleci/node:10
52+
- image: circleci/node:8
4853
steps:
4954
- checkout
5055
- restore-cache: *restore-cache
51-
- run: yarn --no-progress
56+
- run: yarn --no-progress --frozen-lockfile
5257
- save-cache: *save-cache
5358
- run:
5459
command: yarn test-ci-partial
5560
- store_test_results:
5661
path: reports/junit
5762

58-
test-jest-circus:
63+
test-node-10:
5964
working_directory: ~/jest
6065
docker:
6166
- image: circleci/node:10
6267
steps:
6368
- checkout
6469
- restore-cache: *restore-cache
65-
- run: yarn --no-progress
70+
- run: yarn --no-progress --frozen-lockfile
6671
- save-cache: *save-cache
6772
- run:
68-
command: JEST_CIRCUS=1 yarn test-ci-partial
73+
command: yarn test-ci
6974
- store_test_results:
7075
path: reports/junit
7176

72-
test-node-8:
77+
test-jest-circus:
7378
working_directory: ~/jest
7479
docker:
75-
- image: circleci/node:8
80+
- image: circleci/node:10
7681
steps:
7782
- checkout
7883
- restore-cache: *restore-cache
79-
- run: yarn --no-progress
84+
- run: yarn --no-progress --frozen-lockfile
8085
- save-cache: *save-cache
8186
- run:
82-
command: yarn test-ci
87+
command: JEST_CIRCUS=1 yarn test-ci-partial
8388
- store_test_results:
8489
path: reports/junit
8590

86-
test-node-6:
91+
test-node-11:
8792
working_directory: ~/jest
8893
docker:
89-
- image: circleci/node:6
94+
- image: circleci/node:11
9095
steps:
9196
- checkout
9297
- restore-cache: *restore-cache
93-
- run: yarn --no-progress --ignore-engines
98+
- run: yarn --no-progress --frozen-lockfile
9499
- save-cache: *save-cache
95100
- run:
96-
# react-native does not work with node 6
97-
command: rm -rf examples/react-native && yarn test-ci-partial
101+
command: yarn test-ci-partial
98102
- store_test_results:
99103
path: reports/junit
100104

105+
test-browser:
106+
working_directory: ~/jest
107+
docker:
108+
- image: circleci/node:10-browsers
109+
steps:
110+
- checkout
111+
- restore-cache: *restore-cache
112+
- run: yarn --no-progress --frozen-lockfile
113+
- save-cache: *save-cache
114+
- run: yarn test-ci-es5-build-in-browser
115+
101116
test-or-deploy-website:
102117
working_directory: ~/jest
103118
docker:
104-
- image: circleci/node:8
119+
- image: circleci/node:10
105120
resource_class: large
106121
steps:
107122
- checkout
108123
- restore-cache: *restore-cache
109-
- run: yarn --no-progress
124+
- run: yarn --no-progress --frozen-lockfile
110125
- save-cache: *save-cache
111126
- run:
112127
name: Test or Deploy Jest Website
@@ -118,10 +133,11 @@ workflows:
118133
build-and-deploy:
119134
jobs:
120135
- lint-and-typecheck
121-
- test-node-8
122136
- test-node-6
137+
- test-node-8
123138
- test-node-10
124139
- test-jest-circus
140+
- test-node-11 # current
125141
- test-browser
126142
- test-or-deploy-website:
127143
filters: *filter-ignore-gh-pages

β€Ž.eslintrc.js

+19-60
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
const path = require('path');
9-
const customImportResolver = path.resolve('./eslintImportResolver');
10-
118
module.exports = {
129
extends: [
1310
'./packages/eslint-config-fb-strict/index.js',
@@ -16,6 +13,22 @@ module.exports = {
1613
'prettier/flowtype',
1714
],
1815
overrides: [
16+
{
17+
files: ['*.ts', '*.tsx'],
18+
parser: '@typescript-eslint/parser',
19+
plugins: ['@typescript-eslint/eslint-plugin'],
20+
rules: {
21+
'@typescript-eslint/array-type': ['error', 'generic'],
22+
'@typescript-eslint/ban-types': 'error',
23+
'@typescript-eslint/no-unused-vars': [
24+
'error',
25+
{argsIgnorePattern: '^_'},
26+
],
27+
'import/order': 'error',
28+
'no-dupe-class-members': 'off',
29+
'no-unused-vars': 'off',
30+
},
31+
},
1932
// to make it more suitable for running on code examples in docs/ folder
2033
{
2134
files: ['*.md'],
@@ -51,53 +64,11 @@ module.exports = {
5164
},
5265
},
5366
{
54-
files: 'types/**/*',
67+
files: ['packages/jest-types/**/*'],
5568
rules: {
5669
'import/no-extraneous-dependencies': 0,
5770
},
5871
},
59-
{
60-
excludedFiles: ['e2e/__tests__/**/*', 'website/versioned_docs/**/*.md'],
61-
files: [
62-
'examples/**/*',
63-
'scripts/**/*',
64-
'e2e/*/**/*',
65-
'website/*.js',
66-
'website/*/**/*',
67-
'eslintImportResolver.js',
68-
],
69-
rules: {
70-
'prettier/prettier': [
71-
2,
72-
{
73-
bracketSpacing: false,
74-
printWidth: 80,
75-
singleQuote: true,
76-
trailingComma: 'es5',
77-
},
78-
],
79-
},
80-
},
81-
{
82-
files: [
83-
'e2e/__tests__/**/*',
84-
'packages/babel-jest/**/*.test.js',
85-
'packages/babel-plugin-jest-hoist/**/*.test.js',
86-
'packages/babel-preset-jest/**/*.test.js',
87-
'packages/eslint-config-fb-strict/**/*.test.js',
88-
'packages/eslint-plugin-jest/**/*.test.js',
89-
'packages/jest-changed-files/**/*.test.js',
90-
'packages/jest-circus/**/*.test.js',
91-
'packages/jest-diff/**/*.test.js',
92-
'packages/jest-docblock/**/*.test.js',
93-
'packages/jest-editor-support/**/*.test.js',
94-
'packages/jest/**/*.test.js',
95-
'packages/pretty-format/**/*.test.js',
96-
],
97-
rules: {
98-
'flowtype/require-valid-file-annotation': [2, 'always'],
99-
},
100-
},
10172
{
10273
files: [
10374
'website/**',
@@ -136,23 +107,11 @@ module.exports = {
136107
'import/order': 0,
137108
'no-console': 0,
138109
'no-unused-vars': 2,
139-
'prettier/prettier': [
140-
2,
141-
{
142-
bracketSpacing: false,
143-
printWidth: 80,
144-
singleQuote: true,
145-
trailingComma: 'all',
146-
},
147-
],
110+
'prettier/prettier': 2,
148111
},
149112
settings: {
150113
'import/resolver': {
151-
[customImportResolver]: {
152-
moduleNameMapper: {
153-
'^types/(.*)': './types/$1',
154-
},
155-
},
114+
'eslint-import-resolver-typescript': true,
156115
},
157116
},
158117
};

β€Ž.flowconfig

-21
This file was deleted.

β€Ž.github/ISSUE_TEMPLATE/bug.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: πŸ› Bug report
3+
labels: Bug Report, Needs Triage, Needs Repro
34
about: Create a report to help us improve
45
---
56

β€Ž.github/ISSUE_TEMPLATE/feature.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: πŸš€ Feature Proposal
3+
labels: ':rocket: Feature Request'
34
about: Submit a proposal for a new feature
45
---
56

0 commit comments

Comments
Β (0)