Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jestjs/jest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 67c1aa20c5fec31366d733e901fee2b981cb1850
Choose a base ref
...
head repository: jestjs/jest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8f9b812faf8e4d241d560a8574f0c6ed20a89365
Choose a head ref

Commits on Feb 8, 2022

  1. Copy the full SHA
    4ed59fb View commit details
  2. chore: update resolve

    SimenB committed Feb 8, 2022
    Copy the full SHA
    2f5a93d View commit details

Commits on Feb 9, 2022

  1. Copy the full SHA
    6c54435 View commit details
  2. chore(ci): prepare yarn cache for all 3 OSes

    Not really necessary, but default cache key for GH Actions includes the
    OS name.
    SimenB committed Feb 9, 2022
    Copy the full SHA
    3ccde93 View commit details
  3. Copy the full SHA
    7e484b2 View commit details
  4. Copy the full SHA
    432dfb6 View commit details
  5. Copy the full SHA
    b4d373e View commit details
  6. Copy the full SHA
    f6c809b View commit details
  7. Copy the full SHA
    4af559a View commit details
  8. Copy the full SHA
    d406172 View commit details
  9. Copy the full SHA
    12dfa25 View commit details
  10. Copy the full SHA
    5587740 View commit details
  11. Copy the full SHA
    e98d044 View commit details
  12. Copy the full SHA
    78faa85 View commit details
  13. Copy the full SHA
    457b5f9 View commit details
  14. Copy the full SHA
    86bf6fc View commit details
  15. Copy the full SHA
    f5aeae7 View commit details
  16. Copy the full SHA
    d7f628c View commit details
  17. Copy the full SHA
    5f1d31c View commit details
  18. Copy the full SHA
    f2e3040 View commit details
  19. Copy the full SHA
    5fdbf84 View commit details
  20. Copy the full SHA
    b89a1bb View commit details
  21. Copy the full SHA
    d193e5e View commit details
  22. Copy the full SHA
    54bfc1c View commit details
  23. Copy the full SHA
    1b402ab View commit details
  24. Copy the full SHA
    7f7b3fb View commit details
  25. fix(expect): move typings of .not, .rejects and .resolves modif…

    …iers outside of `Matchers` interface (#12346)
    mrazauskas authored Feb 9, 2022
    Copy the full SHA
    e9eced4 View commit details
  26. Copy the full SHA
    819c2be View commit details
  27. Copy the full SHA
    8791705 View commit details
  28. Copy the full SHA
    2953433 View commit details

Commits on Feb 10, 2022

  1. chore: update to eslint@8 (#12356)

    SimenB authored Feb 10, 2022
    Copy the full SHA
    cbc41c2 View commit details
  2. Copy the full SHA
    45f5a43 View commit details
  3. Copy the full SHA
    a651b65 View commit details
  4. Copy the full SHA
    4255241 View commit details
  5. Copy the full SHA
    a8e997a View commit details
  6. refactor(jest-jasmine2, jest-runtime): use Symbol to pass `jest.setTi…

    …meout` value instead of `jasmine` specific logic (#12124)
    mrazauskas authored Feb 10, 2022
    Copy the full SHA
    ff7a751 View commit details
  7. Copy the full SHA
    feec3d6 View commit details
  8. Copy the full SHA
    c97a00c View commit details
  9. Copy the full SHA
    df0c496 View commit details
  10. Copy the full SHA
    0c455a9 View commit details
  11. chore: bump @types/jest (#12361)

    SimenB authored Feb 10, 2022
    Copy the full SHA
    65f9487 View commit details
  12. Copy the full SHA
    0d0844a View commit details
  13. Copy the full SHA
    a5f58b5 View commit details
  14. Copy the full SHA
    b9e3a55 View commit details
  15. v28.0.0-alpha.0

    SimenB committed Feb 10, 2022
    Copy the full SHA
    89275b0 View commit details
  16. Copy the full SHA
    5b14366 View commit details

Commits on Feb 11, 2022

  1. chore: re-order changelog

    SimenB committed Feb 11, 2022
    Copy the full SHA
    048d1c5 View commit details
  2. Copy the full SHA
    8c52045 View commit details
  3. Copy the full SHA
    bc0a91a View commit details
  4. Copy the full SHA
    e3c84b5 View commit details
Showing 1,182 changed files with 31,017 additions and 47,505 deletions.
26 changes: 6 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -19,54 +19,40 @@ jobs:
parameters:
node-version:
type: string
partial:
type: boolean
default: false
working_directory: ~/jest
executor: node/default
parallelism: 4
steps:
- checkout
- node/install:
node-version: << parameters.node-version >>
- node/install-packages: *install
- when:
condition: << parameters.partial >>
steps:
- run:
command: yarn test-ci-partial
- unless:
condition: << parameters.partial >>
steps:
- run:
command: yarn test-ci
- run:
command: yarn test-ci-partial --shard=$(expr $CIRCLE_NODE_INDEX + 1)/$CIRCLE_NODE_TOTAL
- store_test_results:
path: reports/junit

test-jest-jasmine:
working_directory: ~/jest
executor: node/default
parallelism: 4
steps:
- checkout
- node/install:
node-version: lts/*
- node/install-packages: *install
- run:
command: JEST_JASMINE=1 yarn test-ci-partial && JEST_JASMINE=1 yarn test-leak
command: JEST_JASMINE=1 yarn test-ci-partial --shard=$(expr $CIRCLE_NODE_INDEX + 1)/$CIRCLE_NODE_TOTAL && JEST_JASMINE=1 yarn test-leak
- store_test_results:
path: reports/junit

# Workflows enables us to run multiple jobs in parallel
workflows:
build-and-deploy:
jobs:
- test-node:
matrix:
parameters:
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', '14', '16', '17', '18']
- test-jest-jasmine
13 changes: 13 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
codecov:
require_ci_to_pass: false

comment: false

coverage:
status:
patch:
default:
target: auto
project:
default:
target: auto
11 changes: 8 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
!.*
**/coverage/**
**/node_modules/**
bin/
flow-typed/**
packages/*/build/**
packages/*/dist/**
packages/jest-diff/src/cleanupSemantic.ts
website/.docusaurus
website/blog
website/build
website/node_modules
website/i18n/*.js
website/static
!.eslintrc.js

# Third-party script
packages/jest-diff/src/cleanupSemantic.ts

**/.yarn
**/.pnp.*

8 changes: 6 additions & 2 deletions .eslintplugin/index.js
Original file line number Diff line number Diff line change
@@ -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'),
};
101 changes: 54 additions & 47 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -5,24 +5,35 @@
* LICENSE file in the root directory of this source tree.
*/

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

const internalPackages = getPackages()
.map(({pkg}) => pkg.name)
.sort();
function getPackages() {
const PACKAGES_DIR = path.resolve(__dirname, 'packages');
const packages = fs
.readdirSync(PACKAGES_DIR)
.map(file => path.resolve(PACKAGES_DIR, file))
.filter(f => fs.lstatSync(path.resolve(f)).isDirectory());
return packages.map(packageDir => {
const pkg = readPkg({cwd: packageDir});
return pkg.name;
});
}

module.exports = {
env: {
es2020: true,
'jest/globals': true,
node: true,
},
extends: [
'plugin:markdown/recommended',
'plugin:import/errors',
'plugin:eslint-comments/recommended',
'plugin:prettier/recommended',
],
globals: {
BigInt: 'readonly',
console: 'readonly',
},
overrides: [
{
@@ -35,19 +46,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
// TS verifies these
'consistent-return': 'off',
// Since we do `export =`. Remove for Jest 27
'import/default': 'off',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
},
@@ -95,12 +100,9 @@ module.exports = {
'packages/expect/src/matchers.ts',
'packages/expect/src/print.ts',
'packages/expect/src/toThrowMatchers.ts',
'packages/expect/src/utils.ts',
'packages/jest-core/src/ReporterDispatcher.ts',
'packages/jest-core/src/TestScheduler.ts',
'packages/expect-utils/src/utils.ts',
'packages/jest-core/src/collectHandles.ts',
'packages/jest-core/src/plugins/UpdateSnapshotsInteractive.ts',
'packages/jest-fake-timers/src/legacyFakeTimers.ts',
'packages/jest-haste-map/src/index.ts',
'packages/jest-haste-map/src/watchers/FSEventsWatcher.ts',
'packages/jest-jasmine2/src/jasmine/SpyStrategy.ts',
@@ -113,8 +115,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',
],
@@ -142,10 +142,12 @@ module.exports = {

// to make it more suitable for running on code examples in docs/ folder
{
files: ['*.md'],
files: ['**/*.md/**'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'arrow-body-style': 'off',
'consistent-return': 'off',
'import/export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'no-console': 'off',
@@ -157,7 +159,7 @@ module.exports = {
},
// snapshots in examples plus inline snapshots need to keep backtick
{
files: ['*.md', 'e2e/custom-inline-snapshot-matchers/__tests__/*'],
files: ['**/*.md/**', 'e2e/custom-inline-snapshot-matchers/__tests__/*'],
rules: {
quotes: [
'error',
@@ -171,6 +173,7 @@ module.exports = {
rules: {
'import/order': 'off',
'import/sort-keys': 'off',
'no-restricted-globals': ['off'],
'sort-keys': 'off',
},
},
@@ -181,12 +184,6 @@ module.exports = {
'import/order': 'off',
},
},
{
files: 'packages/jest-types/**/*',
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
{
files: 'packages/**/*.ts',
rules: {
@@ -220,8 +217,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',
@@ -234,33 +230,40 @@ module.exports = {
'e2e/jasmine-async/__tests__/*',
],
globals: {
fail: true,
jasmine: true,
pending: true,
fail: 'readonly',
jasmine: 'readonly',
pending: 'readonly',
},
},
{
files: [
'e2e/**',
'website/**',
'**/__benchmarks__/**',
'**/__tests__/**',
'e2e/**',
'**/pretty-format/perf/**',
'packages/jest-types/**/*',
'.eslintplugin/**',
],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['**/__typetests__/**', '*.md'],
files: ['**/__typetests__/**', '**/*.md/**'],
rules: {
'jest/no-focused-tests': 'off',
'jest/no-identical-title': 'off',
'jest/valid-expect': 'off',
},
},
{
env: {node: true},
files: ['*.js', '*.jsx', '*.mjs', '*.cjs'],
},
{
files: [
'scripts/*',
'packages/*/__benchmarks__/test.js',
'packages/jest-cli/src/init/index.ts',
'packages/jest-repl/src/cli/runtime-cli.ts',
],
@@ -272,14 +275,10 @@ module.exports = {
files: [
'e2e/**',
'examples/**',
'scripts/*',
'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',
@@ -293,7 +292,7 @@ module.exports = {
parserOptions: {
sourceType: 'module',
},
plugins: ['markdown', 'import', 'jest'],
plugins: ['import', 'jest'],
rules: {
'accessor-pairs': ['warn', {setWithoutGet: true}],
'block-scoped-var': 'off',
@@ -327,7 +326,7 @@ module.exports = {
'scripts/**',
'babel.config.js',
'testSetupFile.js',
'.eslintrc.js',
'.eslintrc.cjs',
],
},
],
@@ -367,7 +366,6 @@ module.exports = {
'no-bitwise': 'warn',
'no-caller': 'error',
'no-case-declarations': 'off',
'no-catch-shadow': 'error',
'no-class-assign': 'warn',
'no-cond-assign': 'off',
'no-confusing-arrow': 'off',
@@ -429,13 +427,20 @@ module.exports = {
'no-octal': 'warn',
'no-octal-escape': 'warn',
'no-param-reassign': 'off',
'no-path-concat': 'off',
'no-plusplus': 'off',
'no-process-env': 'off',
'no-process-exit': 'off',
'no-proto': 'error',
'no-prototype-builtins': 'error',
'no-redeclare': 'warn',
'no-regex-spaces': 'warn',
'no-restricted-globals': [
'error',
{
message: 'Use `globalThis` instead.',
name: 'global',
},
],
'no-restricted-imports': [
'error',
{message: 'Please use graceful-fs instead.', name: 'fs'},
@@ -462,9 +467,9 @@ module.exports = {
'no-unused-expressions': 'off',
'no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
'no-use-before-define': 'off',
'no-useless-call': 'warn',
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'warn',
'no-useless-concat': 'error',
'no-var': 'error',
'no-void': 'off',
'no-warn-comments': 'off',
@@ -476,7 +481,7 @@ module.exports = {
'padded-blocks': 'off',
'prefer-arrow-callback': ['error', {allowNamedFunctions: true}],
'prefer-const': 'error',
'prefer-template': 'off',
'prefer-template': 'error',
quotes: [
'error',
'single',
@@ -502,7 +507,9 @@ module.exports = {
'import/ignore': ['react-native'],
// using `new RegExp` makes sure to escape `/`
'import/internal-regex': new RegExp(
internalPackages.map(pkg => `^${pkg}$`).join('|'),
getPackages()
.map(pkg => `^${pkg}$`)
.join('|'),
).source,
'import/resolver': {
typescript: {},
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
Loading