Skip to content

Commit 1283494

Browse files
committed
Merge branch 'main' into add-mts-and-cts-to-moduleFileExtensions
2 parents 38fca69 + f38c05c commit 1283494

File tree

796 files changed

+8482
-83973
lines changed

Some content is hidden

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

796 files changed

+8482
-83973
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ workflows:
5959
matrix:
6060
parameters:
6161
# For some reason, v20 fails to run yarn install…
62-
node-version: ['14', '16', '18', '19']
62+
node-version: ['16', '18']
6363
- 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/renovate.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["config:base"],
4-
"lockFileMaintenance": {"enabled": true, "automerge": true},
4+
"lockFileMaintenance": {"enabled": true, "automerge": false},
55
"rangeStrategy": "replace",
66
"postUpdateOptions": ["yarnDedupeHighest"],
77
"packageRules": [
88
{
99
"matchPackageNames": ["@tsd/typescript", "typescript"],
1010
"groupName": "typescript"
11+
},
12+
{
13+
"matchPackageNames": ["jest-runner-tsd", "tsd-lite"],
14+
"groupName": "tsd"
1115
}
1216
]
1317
}

.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 }}

.github/workflows/nodejs.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ on:
55
branches:
66
- main
77
pull_request:
8-
branches:
9-
- '**'
8+
merge_group:
109

1110
concurrency:
1211
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -35,7 +34,7 @@ jobs:
3534
needs: prepare-yarn-cache-ubuntu
3635

3736
steps:
38-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3938
with:
4039
persist-credentials: false
4140
- uses: actions/setup-node@v3
@@ -50,7 +49,7 @@ jobs:
5049
run: yarn test-ts --selectProjects ts-integration
5150
- name: type tests
5251
run: yarn test-ts --selectProjects type-tests
53-
- name: verify TypeScript@4.3 compatibility
52+
- name: verify TypeScript@5.0 compatibility
5453
run: yarn verify-old-ts
5554
- name: run ESLint with type info
5655
run: yarn lint-ts-files
@@ -61,7 +60,7 @@ jobs:
6160
needs: prepare-yarn-cache-ubuntu
6261

6362
steps:
64-
- uses: actions/checkout@v3
63+
- uses: actions/checkout@v4
6564
with:
6665
persist-credentials: false
6766
- uses: actions/setup-node@v3
@@ -83,7 +82,7 @@ jobs:
8382
needs: prepare-yarn-cache-ubuntu
8483

8584
steps:
86-
- uses: actions/checkout@v3
85+
- uses: actions/checkout@v4
8786
with:
8887
persist-credentials: false
8988
- uses: actions/setup-node@v3
@@ -110,7 +109,7 @@ jobs:
110109
runs-on: ubuntu-latest
111110
needs: prepare-yarn-cache-ubuntu
112111
steps:
113-
- uses: actions/checkout@v3
112+
- uses: actions/checkout@v4
114113
with:
115114
persist-credentials: false
116115
- uses: actions/setup-node@v3
@@ -125,26 +124,44 @@ jobs:
125124
test-ubuntu:
126125
uses: ./.github/workflows/test.yml
127126
needs: prepare-yarn-cache-ubuntu
127+
strategy:
128+
fail-fast: false
129+
matrix:
130+
shard: ['1/4', '2/4', '3/4', '4/4']
131+
name: Ubuntu with shard ${{ matrix.shard }}
128132
with:
129133
os: ubuntu-latest
134+
shard: ${{ matrix.shard }}
130135
test-macos:
131136
uses: ./.github/workflows/test.yml
132137
needs: prepare-yarn-cache-macos
138+
strategy:
139+
fail-fast: false
140+
matrix:
141+
shard: ['1/3', '2/3', '3/3']
142+
name: macOS with shard ${{ matrix.shard }}
133143
with:
134144
os: macos-latest
145+
shard: ${{ matrix.shard }}
135146
test-windows:
136147
uses: ./.github/workflows/test.yml
137148
needs: prepare-yarn-cache-windows
149+
strategy:
150+
fail-fast: false
151+
matrix:
152+
shard: ['1/4', '2/4', '3/4', '4/4']
153+
name: Windows with shard ${{ matrix.shard }}
138154
with:
139155
os: windows-latest
156+
shard: ${{ matrix.shard }}
140157

141158
test-leak:
142159
name: Node LTS on Ubuntu with leak detection
143160
runs-on: ubuntu-latest
144161
needs: prepare-yarn-cache-ubuntu
145162

146163
steps:
147-
- uses: actions/checkout@v3
164+
- uses: actions/checkout@v4
148165
with:
149166
persist-credentials: false
150167
- name: Use Node.js LTS
@@ -169,7 +186,7 @@ jobs:
169186
needs: prepare-yarn-cache-ubuntu
170187

171188
steps:
172-
- uses: actions/checkout@v3
189+
- uses: actions/checkout@v4
173190
with:
174191
persist-credentials: false
175192
- name: Use Node.js LTS
@@ -183,7 +200,7 @@ jobs:
183200
run: yarn build:js
184201
- name: Get number of CPU cores
185202
id: cpu-cores
186-
uses: SimenB/github-actions-cpu-cores@v1
203+
uses: SimenB/github-actions-cpu-cores@v2
187204
- name: run tests with coverage
188205
run: yarn jest-coverage --color --config jest.config.ci.mjs --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{ matrix.shard }}
189206
- name: map coverage

.github/workflows/prepare-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ${{ inputs.os }}
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
persist-credentials: false
1919

0 commit comments

Comments
 (0)