Skip to content

Commit

Permalink
Merge branch 'main' into add-mts-and-cts-to-moduleFileExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 20, 2023
2 parents 38fca69 + f38c05c commit 1283494
Show file tree
Hide file tree
Showing 796 changed files with 8,482 additions and 83,973 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ workflows:
matrix:
parameters:
# For some reason, v20 fails to run yarn install…
node-version: ['14', '16', '18', '19']
node-version: ['16', '18']
- test-jest-jasmine
28 changes: 20 additions & 8 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ module.exports = {
},
overrides: [
{
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:import/typescript',
],
extends: ['plugin:@typescript-eslint/strict', 'plugin:import/typescript'],
files: ['*.ts', '*.tsx'],
plugins: ['@typescript-eslint/eslint-plugin', 'local'],
rules: {
Expand All @@ -61,9 +57,15 @@ module.exports = {
'consistent-return': 'off',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
// TODO: enable at some point
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',

// TODO: part of "stylistic" rules, remove explicit activation when that lands
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'error',
},
},
{
Expand Down Expand Up @@ -128,7 +130,7 @@ module.exports = {
rules: {
'@typescript-eslint/ban-types': [
'error',
// TODO: remove these overrides: https://github.com/facebook/jest/issues/10177
// TODO: remove these overrides: https://github.com/jestjs/jest/issues/10177
{types: {Function: false, object: false, '{}': false}},
],
'local/ban-types-eventually': [
Expand Down Expand Up @@ -347,6 +349,8 @@ module.exports = {
files: ['**/__typetests__/**'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
},
},
{
Expand All @@ -357,7 +361,7 @@ module.exports = {
files: [
'scripts/*',
'packages/*/__benchmarks__/test.js',
'packages/jest-cli/src/init/index.ts',
'packages/create-jest/src/runCreate.ts',
'packages/jest-repl/src/cli/runtime-cli.ts',
],
rules: {
Expand All @@ -374,6 +378,7 @@ module.exports = {
'**/__typetests__/**',
],
rules: {
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'import/no-unresolved': 'off',
'no-console': 'off',
Expand All @@ -385,7 +390,7 @@ module.exports = {
parserOptions: {
sourceType: 'module',
},
plugins: ['import', 'jsdoc'],
plugins: ['import', 'jsdoc', 'unicorn'],
rules: {
'accessor-pairs': ['warn', {setWithoutGet: true}],
'block-scoped-var': 'off',
Expand Down Expand Up @@ -590,6 +595,13 @@ module.exports = {
'wrap-iife': 'off',
'wrap-regex': 'off',
yoda: 'off',

'unicorn/explicit-length-check': 'error',
'unicorn/no-array-for-each': 'error',
'unicorn/no-negated-condition': 'error',
'unicorn/prefer-default-parameters': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/template-indent': 'error',
},
settings: {
'import/ignore': ['react-native'],
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 👉 [Please follow one of these issue templates](https://github.com/facebook/jest/issues/new/choose) 👈
## 👉 [Please follow one of these issue templates](https://github.com/jestjs/jest/issues/new/choose) 👈

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

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ body:
label: Version
description: |
The version of Jest you are using.
Is it the [latest](https://github.com/facebook/jest/releases)? Test and see if the bug has already been fixed.
Is it the [latest](https://github.com/jestjs/jest/releases)? Test and see if the bug has already been fixed.
placeholder: ex. 27.0.6
validations:
required: true
Expand Down
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Documentation 📖
description: Submit a request to add or update documentation
title: '[Docs]: '
labels: ['Documentation :book:']
body:
- type: markdown
attributes:
value: |
### Thank you for helping us improve our documentation!
Please be sure you are looking at [the latest version of the documentation](https://jestjs.io/docs) before opening an issue here.
- type: textarea
id: links
attributes:
label: Page(s)
description: |
Links to one or more documentation pages that should be modified.
If you are reporting an issue with a specific section of a page, try to link directly to the nearest anchor.
If you are suggesting that a new page be created, link to the parent of the proposed page.
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: |
Describe the change you are requesting.
If the issue pertains to a single function or matcher, be sure to specify the entire call signature.
validations:
required: true
6 changes: 5 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"lockFileMaintenance": {"enabled": true, "automerge": true},
"lockFileMaintenance": {"enabled": true, "automerge": false},
"rangeStrategy": "replace",
"postUpdateOptions": ["yarnDedupeHighest"],
"packageRules": [
{
"matchPackageNames": ["@tsd/typescript", "typescript"],
"groupName": "typescript"
},
{
"matchPackageNames": ["jest-runner-tsd", "tsd-lite"],
"groupName": "tsd"
}
]
}
52 changes: 52 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Node Nightly CI

on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
prepare-yarn-cache-ubuntu:
uses: ./.github/workflows/prepare-cache.yml
with:
os: ubuntu-latest
prepare-yarn-cache-macos:
uses: ./.github/workflows/prepare-cache.yml
with:
os: macos-latest
prepare-yarn-cache-windows:
uses: ./.github/workflows/prepare-cache.yml
with:
os: windows-latest

test-ubuntu:
uses: ./.github/workflows/test-nightly.yml
needs: prepare-yarn-cache-ubuntu
with:
os: ubuntu-latest
test-macos:
uses: ./.github/workflows/test-nightly.yml
needs: prepare-yarn-cache-macos
with:
os: macos-latest
test-windows:
uses: ./.github/workflows/test-nightly.yml
needs: prepare-yarn-cache-windows
with:
os: windows-latest
notify:
name: Notify failed build
needs: [test-ubuntu, test-macos, test-windows]
if: failure()
runs-on: ubuntu-latest
steps:
- uses: jayqi/failed-build-issue-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 27 additions & 10 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- main
pull_request:
branches:
- '**'
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -35,7 +34,7 @@ jobs:
needs: prepare-yarn-cache-ubuntu

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v3
Expand All @@ -50,7 +49,7 @@ jobs:
run: yarn test-ts --selectProjects ts-integration
- name: type tests
run: yarn test-ts --selectProjects type-tests
- name: verify TypeScript@4.3 compatibility
- name: verify TypeScript@5.0 compatibility
run: yarn verify-old-ts
- name: run ESLint with type info
run: yarn lint-ts-files
Expand All @@ -61,7 +60,7 @@ jobs:
needs: prepare-yarn-cache-ubuntu

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v3
Expand All @@ -83,7 +82,7 @@ jobs:
needs: prepare-yarn-cache-ubuntu

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v3
Expand All @@ -110,7 +109,7 @@ jobs:
runs-on: ubuntu-latest
needs: prepare-yarn-cache-ubuntu
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v3
Expand All @@ -125,26 +124,44 @@ jobs:
test-ubuntu:
uses: ./.github/workflows/test.yml
needs: prepare-yarn-cache-ubuntu
strategy:
fail-fast: false
matrix:
shard: ['1/4', '2/4', '3/4', '4/4']
name: Ubuntu with shard ${{ matrix.shard }}
with:
os: ubuntu-latest
shard: ${{ matrix.shard }}
test-macos:
uses: ./.github/workflows/test.yml
needs: prepare-yarn-cache-macos
strategy:
fail-fast: false
matrix:
shard: ['1/3', '2/3', '3/3']
name: macOS with shard ${{ matrix.shard }}
with:
os: macos-latest
shard: ${{ matrix.shard }}
test-windows:
uses: ./.github/workflows/test.yml
needs: prepare-yarn-cache-windows
strategy:
fail-fast: false
matrix:
shard: ['1/4', '2/4', '3/4', '4/4']
name: Windows with shard ${{ matrix.shard }}
with:
os: windows-latest
shard: ${{ matrix.shard }}

test-leak:
name: Node LTS on Ubuntu with leak detection
runs-on: ubuntu-latest
needs: prepare-yarn-cache-ubuntu

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js LTS
Expand All @@ -169,7 +186,7 @@ jobs:
needs: prepare-yarn-cache-ubuntu

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js LTS
Expand All @@ -183,7 +200,7 @@ jobs:
run: yarn build:js
- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
- name: run tests with coverage
run: yarn jest-coverage --color --config jest.config.ci.mjs --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{ matrix.shard }}
- name: map coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down
Loading

0 comments on commit 1283494

Please sign in to comment.