Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr/7167
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
thymikee committed Mar 19, 2019
2 parents 05d39b4 + 8cec4cd commit 9d39e68
Show file tree
Hide file tree
Showing 2,424 changed files with 249,505 additions and 132,242 deletions.
45 changes: 45 additions & 0 deletions .azure-pipelines-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Steps for building and testing Jest. See jobs defined in .azure-pipelines.yml
#

# Clones the repo
steps:
- checkout: self

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

# 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'
# Run yarn to install dependencies and build
- script: yarn --frozen-lockfile
workingDirectory: $(JEST_DIR)
displayName: 'Install dependencies and build'

# 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()
40 changes: 40 additions & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Azure Pipelines configuration for building and testing Jest on Linux, Windows, and macOS.
#

jobs:
- job: Linux
pool:
vmImage: ubuntu-16.04
steps:
- template: .azure-pipelines-steps.yml

- job: Windows
pool:
vmImage: vs2017-win2016
steps:
- script: |
git config --global core.autocrlf false
git config --global core.symlinks true
displayName: 'Preserve LF endings and symbolic links on check out'
- template: .azure-pipelines-steps.yml

- job: macOS
pool:
vmImage: macos-10.13
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
displayName: 'Install Mercurial'
- template: .azure-pipelines-steps.yml

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
13 changes: 0 additions & 13 deletions .babelrc

This file was deleted.

64 changes: 40 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,89 +24,104 @@ jobs:
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- 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
- run: echo server.max_workers=1 >> .flowconfig
- 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
- store_test_results:
path: reports/junit

test-browser:
test-node-6:
working_directory: ~/jest
docker:
- image: circleci/node:8-browsers
- image: circleci/node:6
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- run: yarn --no-progress --frozen-lockfile --ignore-engines
- save-cache: *save-cache
- run: yarn test-ci-es5-build-in-browser
- 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-10:
test-node-8:
working_directory: ~/jest
docker:
- image: circleci/node:10
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-jest-circus:
test-node-10:
working_directory: ~/jest
docker:
- image: circleci/node:10
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- run: yarn --no-progress --frozen-lockfile
- 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-8:
test-jest-circus:
working_directory: ~/jest
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
command: yarn test-ci
command: JEST_CIRCUS=1 yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-6:
test-node-11:
working_directory: ~/jest
docker:
- image: circleci/node:6
- image: circleci/node:11
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress --ignore-engines
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
# react-native does not work with node 6
command: rm -rf examples/react-native && yarn test-ci-partial
command: yarn test-ci-partial
- 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:8
- image: circleci/node:10
resource_class: large
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- run: yarn --no-progress --frozen-lockfile
- save-cache: *save-cache
- run:
name: Test or Deploy Jest Website
Expand All @@ -118,10 +133,11 @@ workflows:
build-and-deploy:
jobs:
- lint-and-typecheck
- test-node-8
- 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
79 changes: 19 additions & 60 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

const path = require('path');
const customImportResolver = path.resolve('./eslintImportResolver');

module.exports = {
extends: [
'./packages/eslint-config-fb-strict/index.js',
Expand All @@ -16,6 +13,22 @@ module.exports = {
'prettier/flowtype',
],
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
'@typescript-eslint/array-type': ['error', 'generic'],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'},
],
'import/order': 'error',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
},
},
// to make it more suitable for running on code examples in docs/ folder
{
files: ['*.md'],
Expand Down Expand Up @@ -51,53 +64,11 @@ module.exports = {
},
},
{
files: 'types/**/*',
files: ['packages/jest-types/**/*'],
rules: {
'import/no-extraneous-dependencies': 0,
},
},
{
excludedFiles: ['e2e/__tests__/**/*', 'website/versioned_docs/**/*.md'],
files: [
'examples/**/*',
'scripts/**/*',
'e2e/*/**/*',
'website/*.js',
'website/*/**/*',
'eslintImportResolver.js',
],
rules: {
'prettier/prettier': [
2,
{
bracketSpacing: false,
printWidth: 80,
singleQuote: true,
trailingComma: 'es5',
},
],
},
},
{
files: [
'e2e/__tests__/**/*',
'packages/babel-jest/**/*.test.js',
'packages/babel-plugin-jest-hoist/**/*.test.js',
'packages/babel-preset-jest/**/*.test.js',
'packages/eslint-config-fb-strict/**/*.test.js',
'packages/eslint-plugin-jest/**/*.test.js',
'packages/jest-changed-files/**/*.test.js',
'packages/jest-circus/**/*.test.js',
'packages/jest-diff/**/*.test.js',
'packages/jest-docblock/**/*.test.js',
'packages/jest-editor-support/**/*.test.js',
'packages/jest/**/*.test.js',
'packages/pretty-format/**/*.test.js',
],
rules: {
'flowtype/require-valid-file-annotation': [2, 'always'],
},
},
{
files: [
'website/**',
Expand Down Expand Up @@ -136,23 +107,11 @@ module.exports = {
'import/order': 0,
'no-console': 0,
'no-unused-vars': 2,
'prettier/prettier': [
2,
{
bracketSpacing: false,
printWidth: 80,
singleQuote: true,
trailingComma: 'all',
},
],
'prettier/prettier': 2,
},
settings: {
'import/resolver': {
[customImportResolver]: {
moduleNameMapper: {
'^types/(.*)': './types/$1',
},
},
'eslint-import-resolver-typescript': true,
},
},
};
21 changes: 0 additions & 21 deletions .flowconfig

This file was deleted.

1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 🐛 Bug report
labels: Bug Report, Needs Triage, Needs Repro
about: Create a report to help us improve
---

Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: 🚀 Feature Proposal
labels: ':rocket: Feature Request'
about: Submit a proposal for a new feature
---

Expand Down
Loading

0 comments on commit 9d39e68

Please sign in to comment.