Skip to content

Commit cbcc1fb

Browse files
committed
Merge branch 'main' into to-match-snap
2 parents 8903419 + d12cbf1 commit cbcc1fb

File tree

884 files changed

+26110
-73790
lines changed

Some content is hidden

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

884 files changed

+26110
-73790
lines changed

.circleci/config.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ aliases:
1212
app-dir: ~/jest
1313

1414
orbs:
15-
node: circleci/node@5.0.3
15+
node: circleci/node@5.1.0
1616

1717
jobs:
1818
test-node:
@@ -58,5 +58,6 @@ workflows:
5858
name: test-node-partial-<< matrix.node-version >>
5959
matrix:
6060
parameters:
61-
node-version: ['14', '16', '18', '19']
61+
# For some reason, v20 fails to run yarn install…
62+
node-version: ['16', '18']
6263
- test-jest-jasmine

.eslintrc.cjs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ module.exports = {
4040
},
4141
overrides: [
4242
{
43-
extends: [
44-
'plugin:@typescript-eslint/recommended',
45-
'plugin:@typescript-eslint/eslint-recommended',
46-
'plugin:import/typescript',
47-
],
43+
extends: ['plugin:@typescript-eslint/strict', 'plugin:import/typescript'],
4844
files: ['*.ts', '*.tsx'],
4945
plugins: ['@typescript-eslint/eslint-plugin', 'local'],
5046
rules: {
@@ -61,9 +57,15 @@ module.exports = {
6157
'consistent-return': 'off',
6258
'no-dupe-class-members': 'off',
6359
'no-unused-vars': 'off',
60+
'@typescript-eslint/no-dynamic-delete': 'off',
6461
// TODO: enable at some point
6562
'@typescript-eslint/no-explicit-any': 'off',
6663
'@typescript-eslint/no-non-null-assertion': 'off',
64+
'@typescript-eslint/no-invalid-void-type': 'off',
65+
66+
// TODO: part of "stylistic" rules, remove explicit activation when that lands
67+
'@typescript-eslint/no-empty-function': 'error',
68+
'@typescript-eslint/no-empty-interface': 'error',
6769
},
6870
},
6971
{
@@ -128,7 +130,7 @@ module.exports = {
128130
rules: {
129131
'@typescript-eslint/ban-types': [
130132
'error',
131-
// TODO: remove these overrides: https://github.com/facebook/jest/issues/10177
133+
// TODO: remove these overrides: https://github.com/jestjs/jest/issues/10177
132134
{types: {Function: false, object: false, '{}': false}},
133135
],
134136
'local/ban-types-eventually': [
@@ -347,6 +349,8 @@ module.exports = {
347349
files: ['**/__typetests__/**'],
348350
rules: {
349351
'@typescript-eslint/no-empty-function': 'off',
352+
'@typescript-eslint/no-invalid-void-type': 'off',
353+
'@typescript-eslint/no-useless-constructor': 'off',
350354
},
351355
},
352356
{
@@ -357,7 +361,7 @@ module.exports = {
357361
files: [
358362
'scripts/*',
359363
'packages/*/__benchmarks__/test.js',
360-
'packages/jest-cli/src/init/index.ts',
364+
'packages/create-jest/src/runCreate.ts',
361365
'packages/jest-repl/src/cli/runtime-cli.ts',
362366
],
363367
rules: {
@@ -374,6 +378,7 @@ module.exports = {
374378
'**/__typetests__/**',
375379
],
376380
rules: {
381+
'@typescript-eslint/no-extraneous-class': 'off',
377382
'@typescript-eslint/no-unused-vars': 'off',
378383
'import/no-unresolved': 'off',
379384
'no-console': 'off',
@@ -385,7 +390,7 @@ module.exports = {
385390
parserOptions: {
386391
sourceType: 'module',
387392
},
388-
plugins: ['import', 'jsdoc'],
393+
plugins: ['import', 'jsdoc', 'unicorn'],
389394
rules: {
390395
'accessor-pairs': ['warn', {setWithoutGet: true}],
391396
'block-scoped-var': 'off',
@@ -590,6 +595,13 @@ module.exports = {
590595
'wrap-iife': 'off',
591596
'wrap-regex': 'off',
592597
yoda: 'off',
598+
599+
'unicorn/explicit-length-check': 'error',
600+
'unicorn/no-array-for-each': 'error',
601+
'unicorn/no-negated-condition': 'error',
602+
'unicorn/prefer-default-parameters': 'error',
603+
'unicorn/prefer-includes': 'error',
604+
'unicorn/template-indent': 'error',
593605
},
594606
settings: {
595607
'import/ignore': ['react-native'],

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 👉 [Please follow one of these issue templates](https://github.com/facebook/jest/issues/new/choose) 👈
1+
## 👉 [Please follow one of these issue templates](https://github.com/jestjs/jest/issues/new/choose) 👈
22

33
<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate -->
44

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ body:
4141
label: Version
4242
description: |
4343
The version of Jest you are using.
44-
Is it the [latest](https://github.com/facebook/jest/releases)? Test and see if the bug has already been fixed.
44+
Is it the [latest](https://github.com/jestjs/jest/releases)? Test and see if the bug has already been fixed.
4545
placeholder: ex. 27.0.6
4646
validations:
4747
required: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Documentation 📖
2+
description: Submit a request to add or update documentation
3+
title: '[Docs]: '
4+
labels: ['Documentation :book:']
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
### Thank you for helping us improve our documentation!
10+
11+
Please be sure you are looking at [the latest version of the documentation](https://jestjs.io/docs) before opening an issue here.
12+
- type: textarea
13+
id: links
14+
attributes:
15+
label: Page(s)
16+
description: |
17+
Links to one or more documentation pages that should be modified.
18+
If you are reporting an issue with a specific section of a page, try to link directly to the nearest anchor.
19+
If you are suggesting that a new page be created, link to the parent of the proposed page.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: description
24+
attributes:
25+
label: Description
26+
description: |
27+
Describe the change you are requesting.
28+
If the issue pertains to a single function or matcher, be sure to specify the entire call signature.
29+
validations:
30+
required: true

.github/dependabot.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/renovate.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:base"],
4+
"lockFileMaintenance": {"enabled": true, "automerge": false},
5+
"rangeStrategy": "replace",
6+
"postUpdateOptions": ["yarnDedupeHighest"],
7+
"packageRules": [
8+
{
9+
"matchPackageNames": ["@tsd/typescript", "typescript"],
10+
"groupName": "typescript"
11+
},
12+
{
13+
"matchPackageNames": ["jest-runner-tsd", "tsd-lite"],
14+
"groupName": "tsd"
15+
}
16+
]
17+
}

.github/workflows/close-stale.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 'Close stale issues and PRs'
22
on:
33
schedule:
4-
- cron: '*/10 * * * *'
4+
- cron: '0 * * * *'
55

66
permissions:
77
issues: write # to close stale issues (actions/stale)
@@ -12,7 +12,7 @@ jobs:
1212
name: 'Close month old issues and PRs'
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/stale@v7
15+
- uses: actions/stale@v8
1616
with:
1717
start-date: '2022-01-01T00:00:00Z'
1818
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
@@ -32,7 +32,7 @@ jobs:
3232
name: 'Close year old issues and PRs'
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/stale@v7
35+
- uses: actions/stale@v8
3636
with:
3737
stale-issue-message: 'This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.'
3838
stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.'

.github/workflows/issues.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ jobs:
1212
name: Questions
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Close Issue
16-
uses: peter-evans/close-issue@v2
17-
if: "${{ github.event.label.name == ':speech_balloon: Question' }}"
18-
with:
19-
comment: Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jestjs) or our [discord channel](https://discord.gg/j6FKKQQrW9) for questions.
15+
- if: "${{ github.event.label.name == ':speech_balloon: Question' }}"
16+
run: gh issue close $ISSUE --comment "Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jestjs) or our [discord channel](https://discord.gg/j6FKKQQrW9) for questions."
17+
env:
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
ISSUE: ${{ github.event.issue.html_url }}
2020
bug-without-repro:
2121
name: Bug reports without reproductions
2222
runs-on: ubuntu-latest
2323
steps:
24-
- name: Close Issue
25-
uses: peter-evans/close-issue@v2
26-
if: "${{ github.event.label.name == 'Needs Reproduction' }}"
27-
with:
28-
comment: As noted in the [Bug Report template](https://github.com/facebook/jest/blob/main/.github/ISSUE_TEMPLATE/bug.yml), all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example.
24+
- if: "${{ github.event.label.name == 'Needs Reproduction' }}"
25+
run: gh issue close $ISSUE --comment "As noted in the [Bug Report template](https://github.com/jestjs/jest/blob/main/.github/ISSUE_TEMPLATE/bug.yml), all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example."
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
ISSUE: ${{ github.event.issue.html_url }}

.github/workflows/nightly.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Node Nightly CI
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 12 * * *'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read # to fetch code (actions/checkout)
14+
15+
jobs:
16+
prepare-yarn-cache-ubuntu:
17+
uses: ./.github/workflows/prepare-cache.yml
18+
with:
19+
os: ubuntu-latest
20+
prepare-yarn-cache-macos:
21+
uses: ./.github/workflows/prepare-cache.yml
22+
with:
23+
os: macos-latest
24+
prepare-yarn-cache-windows:
25+
uses: ./.github/workflows/prepare-cache.yml
26+
with:
27+
os: windows-latest
28+
29+
test-ubuntu:
30+
uses: ./.github/workflows/test-nightly.yml
31+
needs: prepare-yarn-cache-ubuntu
32+
with:
33+
os: ubuntu-latest
34+
test-macos:
35+
uses: ./.github/workflows/test-nightly.yml
36+
needs: prepare-yarn-cache-macos
37+
with:
38+
os: macos-latest
39+
test-windows:
40+
uses: ./.github/workflows/test-nightly.yml
41+
needs: prepare-yarn-cache-windows
42+
with:
43+
os: windows-latest
44+
notify:
45+
name: Notify failed build
46+
needs: [test-ubuntu, test-macos, test-windows]
47+
if: failure()
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: jayqi/failed-build-issue-action@v1
51+
with:
52+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)