Skip to content

Commit

Permalink
Merge commit 'b9e3a55ccbf4c1228190ca3eb47bc680abba103b~' into 9505-je…
Browse files Browse the repository at this point in the history
…st-resolve-async
  • Loading branch information
SimenB committed Feb 22, 2022
2 parents 6a8fa3b + a5f58b5 commit a4b0c8e
Show file tree
Hide file tree
Showing 707 changed files with 22,301 additions and 10,846 deletions.
10 changes: 4 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ aliases:
app-dir: ~/jest

orbs:
node: circleci/node@4.7.0
node: circleci/node@5.0.0

jobs:
test-node:
Expand All @@ -28,7 +28,6 @@ jobs:
- checkout
- node/install:
node-version: << parameters.node-version >>
install-npm: false
- node/install-packages: *install
- when:
condition: << parameters.partial >>
Expand All @@ -49,8 +48,7 @@ jobs:
steps:
- checkout
- node/install:
node-version: '14'
install-npm: false
node-version: lts/*
- node/install-packages: *install
- run:
command: JEST_JASMINE=1 yarn test-ci-partial && JEST_JASMINE=1 yarn test-leak
Expand All @@ -64,11 +62,11 @@ workflows:
- test-node:
matrix:
parameters:
node-version: ['14']
node-version: ['lts/*']
- test-node:
name: test-node-partial-<< matrix.node-version >>
partial: true
matrix:
parameters:
node-version: ['10', '12', '15', '16', '17']
node-version: ['12', '16', '17']
- test-jest-jasmine
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
bin/
flow-typed/**
packages/*/build/**
packages/*/dist/**
packages/jest-diff/src/cleanupSemantic.ts
website/.docusaurus
website/blog
Expand Down
8 changes: 6 additions & 2 deletions .eslintplugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ exports.rules = {
'ban-types-eventually': require('@typescript-eslint/eslint-plugin').rules[
'ban-types'
],
'prefer-rest-params-eventually': require('eslint/lib/rules/prefer-rest-params'),
'prefer-spread-eventually': require('eslint/lib/rules/prefer-spread'),
'prefer-rest-params-eventually':
require('eslint/use-at-your-own-risk').builtinRules.get(
'prefer-rest-params',
),
'prefer-spread-eventually':
require('eslint/use-at-your-own-risk').builtinRules.get('prefer-spread'),
};
52 changes: 31 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/

const {sync: readPkg} = require('read-pkg');
const {getPackages} = require('./scripts/buildUtils');

const internalPackages = getPackages()
.map(packageDir => {
const pkg = readPkg({cwd: packageDir});

return pkg.name;
})
.map(({pkg}) => pkg.name)
.sort();

module.exports = {
Expand All @@ -40,19 +35,13 @@ module.exports = {
rules: {
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-implicit-any-catch': [
'error',
{allowExplicitAny: true},
],
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'},
],
'@typescript-eslint/prefer-ts-expect-error': 'error',
// TS verifies this
'consistent-return': 'off',
// Since we do `export =`. Remove for Jest 27
'import/default': 'off',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
},
Expand Down Expand Up @@ -100,8 +89,7 @@ module.exports = {
'packages/expect/src/matchers.ts',
'packages/expect/src/print.ts',
'packages/expect/src/toThrowMatchers.ts',
'packages/expect/src/types.ts',
'packages/expect/src/utils.ts',
'packages/expect-utils/src/utils.ts',
'packages/jest-core/src/ReporterDispatcher.ts',
'packages/jest-core/src/TestScheduler.ts',
'packages/jest-core/src/collectHandles.ts',
Expand All @@ -119,8 +107,6 @@ module.exports = {
'packages/jest-snapshot/src/printSnapshot.ts',
'packages/jest-snapshot/src/types.ts',
'packages/jest-util/src/convertDescriptorToString.ts',
'packages/jest-worker/src/Farm.ts',
'packages/jest-worker/src/index.ts',
'packages/pretty-format/src/index.ts',
'packages/pretty-format/src/plugins/DOMCollection.ts',
],
Expand Down Expand Up @@ -161,6 +147,17 @@ module.exports = {
'sort-keys': 'off',
},
},
// snapshots in examples plus inline snapshots need to keep backtick
{
files: ['*.md', 'e2e/custom-inline-snapshot-matchers/__tests__/*'],
rules: {
quotes: [
'error',
'single',
{allowTemplateLiterals: true, avoidEscape: true},
],
},
},
{
files: ['website/**/*'],
rules: {
Expand All @@ -186,6 +183,18 @@ module.exports = {
files: 'packages/**/*.ts',
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'error',
'import/no-anonymous-default-export': [
'error',
{
allowAnonymousClass: false,
allowAnonymousFunction: false,
allowArray: false,
allowArrowFunction: false,
allowCallExpression: false,
allowLiteral: false,
allowObject: true,
},
],
},
},
{
Expand All @@ -203,8 +212,7 @@ module.exports = {
{
files: [
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'**/vendor/**/*',
'packages/expect-utils/src/jasmineUtils.ts',
],
rules: {
'eslint-comments/disable-enable-pair': 'off',
Expand Down Expand Up @@ -234,7 +242,7 @@ module.exports = {
},
},
{
files: ['**/__typechecks__/**', '*.md'],
files: ['**/__typetests__/**', '*.md'],
rules: {
'jest/no-focused-tests': 'off',
'jest/no-identical-title': 'off',
Expand All @@ -259,11 +267,13 @@ module.exports = {
'website/**',
'**/__mocks__/**',
'**/__tests__/**',
'**/__typetests__/**',
'**/__performance_tests__/**',
'packages/diff-sequences/perf/index.js',
'packages/pretty-format/perf/test.js',
],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'import/no-unresolved': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
Expand Down Expand Up @@ -303,7 +313,7 @@ module.exports = {
devDependencies: [
'**/__mocks__/**',
'**/__tests__/**',
'**/__typechecks__/**',
'**/__typetests__/**',
'**/?(*.)(spec|test).js?(x)',
'scripts/**',
'babel.config.js',
Expand Down Expand Up @@ -461,7 +471,7 @@ module.exports = {
quotes: [
'error',
'single',
{allowTemplateLiterals: true, avoidEscape: true},
{allowTemplateLiterals: false, avoidEscape: true},
],
radix: 'warn',
'require-jsdoc': 'off',
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@ jobs:

prepare-yarn-cache:
name: Prepare yarn cache
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# for some reason the Windows cache doesn't work
os: [ubuntu-latest, macOS-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: lts/*
cache: yarn

- name: Validate cache
Expand All @@ -46,15 +51,15 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: lts/*
cache: yarn
- name: install
run: yarn --immutable
- name: build
run: yarn build
- name: test typings
run: yarn test-types
- name: verify TypeScript@3.8 compatibility
- name: verify TypeScript@4.2 compatibility
run: yarn verify-old-ts
- name: verify Yarn PnP compatibility
run: yarn verify-pnp
Expand All @@ -69,7 +74,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 15.x, 16.x, 17.x]
node-version: [12.x, 14.x, 16.x, 17.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs: prepare-yarn-cache
Expand Down Expand Up @@ -114,10 +119,10 @@ jobs:
git config --global core.symlinks true
if: runner.os == 'Windows'
- uses: actions/checkout@v2
- name: Use Node.js 14.x
- name: Use Node.js LTS
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: lts/*
cache: yarn
- name: install
run: yarn --immutable
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/node_modules

/packages/*/build/
/packages/*/dist/
/packages/*/coverage/
/packages/*/node_modules/

Expand All @@ -40,6 +41,7 @@ junit.xml
package-lock.json

*.tsbuildinfo
api-extractor.json

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored but nested for e2e directories
**/.yarn/*
Expand Down
5 changes: 0 additions & 5 deletions .npmignore

This file was deleted.

356 changes: 321 additions & 35 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.4.3.cjs

This file was deleted.

768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.1.cjs

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ enableGlobalCache: true

nodeLinker: node-modules

packageExtensions:
react-native-codegen@*:
peerDependencies:
"@babel/preset-env": ^7.1.6
react-native@*:
peerDependencies:
"@babel/preset-env": ^7.1.6

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-2.4.3.cjs
yarnPath: .yarn/releases/yarn-3.1.1.cjs
Loading

0 comments on commit a4b0c8e

Please sign in to comment.