Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into circus-add-test-w…
Browse files Browse the repository at this point in the history
…hile-running

* upstream/master: (331 commits)
  chore: update ts-eslint (jestjs#9953)
  Updated config docs with default transform value (jestjs#8583)
  Update jest-phabricator documentation (jestjs#8662)
  chore: remove dependency on `realpath-native` (jestjs#9952)
  chore: bump dated dependencies (jestjs#9951)
  chore: another try at fixing test-utils dependency
  chore: update lockfile due to beta release
  chore: move changelog entry and fix tets utils dependency
  Fix time duration formatting as per SI (jestjs#9765)
  v26.0.0-alpha.0
  chore: run some jsdom tests in leak check (jestjs#9938)
  chore: upgrade chalk to v4 (jestjs#9752)
  feat: upgrade to JSDOM 16 (jestjs#9606)
  chore: remove checks for compileFunction (jestjs#9949)
  chore: drop node 8 support  (jestjs#9423)
  Remove leftover `providesModuleNodeModules` (jestjs#9948)
  [BREAKING] Pojer -> Nakazawa
  chore: revert lockfile changes from 2b32fe6
  chore: move changelog entry and fix lint
  Remove `providesModuleNodeModules` from Jest. (jestjs#9583)
  ...
  • Loading branch information
jeysal committed May 2, 2020
2 parents 5c85971 + 42f920c commit 73b95bc
Show file tree
Hide file tree
Showing 975 changed files with 29,122 additions and 16,974 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines-steps.yml
Expand Up @@ -6,7 +6,7 @@ steps:
- checkout: self
path: jest

# Ensure Node.js 10 is active
# Ensure Node.js 12 is active
- task: NodeTool@0
inputs:
versionSpec: '12.x'
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines.yml
Expand Up @@ -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
Expand Down
44 changes: 9 additions & 35 deletions .circleci/config.yml
Expand Up @@ -18,33 +18,6 @@ aliases:

version: 2
jobs:
lint-and-typecheck:
working_directory: ~/jest
docker:
- image: circleci/node:12
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-8:
working_directory: ~/jest
docker:
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-10:
working_directory: ~/jest
docker:
Expand All @@ -69,7 +42,7 @@ jobs:
- run: *install
- save-cache: *save-cache
- run:
command: JEST_CIRCUS=1 yarn test-ci-partial
command: JEST_CIRCUS=1 yarn test-ci-partial && JEST_CIRCUS=1 yarn test-leak
- store_test_results:
path: reports/junit

Expand Down Expand Up @@ -101,16 +74,19 @@ jobs:
- store_test_results:
path: reports/junit

test-browser:
test-node-14:
working_directory: ~/jest
docker:
- image: circleci/node:12-browsers
- image: circleci/node:14
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run: yarn test-ci-es5-build-in-browser
- run:
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-or-deploy-website:
working_directory: ~/jest
Expand All @@ -131,12 +107,10 @@ workflows:
version: 2
build-and-deploy:
jobs:
- lint-and-typecheck
- test-node-8
- test-node-10
- test-node-12
- test-node-13 # current
- test-node-13
- test-node-14 # current
- test-jest-circus
- test-browser
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
6 changes: 3 additions & 3 deletions .circleci/website.sh
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .eslintignore
Expand Up @@ -3,11 +3,11 @@
bin/
flow-typed/**
packages/*/build/**
packages/*/build-es5/**
packages/jest-diff/src/cleanupSemantic.ts
website/blog
website/build
website/node_modules
website/i18n/*.js
website/translated_docs
website/static
!.eslintrc.js
47 changes: 44 additions & 3 deletions .eslintrc.js
Expand Up @@ -12,6 +12,7 @@ module.exports = {
'plugin:import/typescript',
'prettier',
'prettier/flowtype',
'plugin:eslint-comments/recommended',
],
overrides: [
{
Expand Down Expand Up @@ -67,11 +68,40 @@ module.exports = {
},
},
{
files: ['packages/jest-types/**/*'],
files: 'packages/jest-types/**/*',
rules: {
'import/no-extraneous-dependencies': 0,
},
},
{
files: 'packages/**/*.ts',
rules: {
'@typescript-eslint/explicit-module-boundary-types': 2,
},
},
{
files: [
'**/__tests__/**',
'**/__mocks__/**',
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'**/vendor/**/*',
],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
},
},
{
files: [
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'**/vendor/**/*',
],
rules: {
'eslint-comments/disable-enable-pair': 0,
'eslint-comments/no-unlimited-disable': 0,
},
},
{
files: [
'website/**',
Expand All @@ -85,9 +115,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,
Expand All @@ -100,7 +131,7 @@ module.exports = {
'**/__mocks__/**',
'**/?(*.)(spec|test).js?(x)',
'scripts/**',
'eslintImportResolver.js',
'babel.config.js',
'testSetupFile.js',
],
},
Expand All @@ -110,8 +141,18 @@ module.exports = {
// https://github.com/benmosher/eslint-plugin-import/issues/645
'import/order': 0,
'no-console': 0,
'no-restricted-imports': [
2,
{
message: 'Please use graceful-fs instead.',
name: 'fs',
},
],
'no-unused-vars': 2,
'prettier/prettier': 2,
'sort-imports': [2, {ignoreDeclarationSort: true}],
},
settings: {
'import/ignore': ['react-native'],
},
};
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Expand Up @@ -32,6 +32,6 @@ Run npx envinfo --preset jest
Paste the results here:
-->

```bash
```
```
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/regression.md
Expand Up @@ -34,6 +34,6 @@ Issues without a reproduction link are likely to stall.

Paste the results here:

```bash
```
```
90 changes: 90 additions & 0 deletions .github/workflows/nodejs.yml
@@ -0,0 +1,90 @@
name: Node CI

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

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

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

steps:
- uses: actions/checkout@v2
- 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: verify TypeScript@3.8 compatibility
run: yarn verify-old-ts
- name: run eslint
run: yarn lint
- name: run prettier
run: yarn lint:prettier:ci
- name: check copyright headers
run: yarn check-copyright-headers
test:
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set git config
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
if: runner.os == 'Windows'
- uses: actions/checkout@v2
- 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: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: remove prettier dep
run: yarn remove-prettier-dep
if: matrix.node-version == '8.17.0'
- name: install
run: yarn install-no-ts-build
- name: run tests
run: yarn test-ci-partial
env:
CI: true
7 changes: 6 additions & 1 deletion .gitignore
Expand Up @@ -4,6 +4,7 @@
*.swp
*~
/examples/*/node_modules/
/examples/mongodb/globalConfig.json

/e2e/*/node_modules
/e2e/*/.pnp
Expand All @@ -16,7 +17,6 @@
/node_modules

/packages/*/build/
/packages/*/build-es5/
/packages/*/coverage/
/packages/*/node_modules/
/packages/*/package-lock.json
Expand All @@ -38,3 +38,8 @@ yarn-error.log*
junit.xml

*.tsbuildinfo

.pnp.js
.yarn/unplugged/
.yarn/build-state.yml
e2e/async-regenerator/.yarn/
13 changes: 9 additions & 4 deletions .vscode/launch.json
Expand Up @@ -7,10 +7,15 @@
{
"type": "node",
"request": "launch",
"name": "Debug Jest with current test file",
"program": "${workspaceFolder}/packages/jest-cli/bin/jest.js",
"args": ["--runInBand", "${file}"],
"runtimeArgs": ["-r", "flow-remove-types/register"]
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${fileBasenameNoExtension}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
}
]
}
7 changes: 4 additions & 3 deletions .vscode/settings.json
Expand Up @@ -5,9 +5,10 @@
"**/node_modules": true,
"**/build": true
},
"editor.formatOnSave": true,
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false,
"jest.pathToJest": "yarn jest --",
"prettier.eslintIntegration": true
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}

0 comments on commit 73b95bc

Please sign in to comment.