Skip to content

Commit

Permalink
Merge branch 'main' into logHeapUsage-process-id
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Nov 16, 2023
2 parents c1afd14 + 3e86cf3 commit 0bd6f1e
Show file tree
Hide file tree
Showing 1,056 changed files with 21,897 additions and 94,689 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,5 @@ workflows:
name: test-node-partial-<< matrix.node-version >>
matrix:
parameters:
# For some reason, v20 fails to run yarn install…
node-version: ['14', '16', '18', '19']
node-version: ['16', '18', '20', '21']
- test-jest-jasmine
60 changes: 51 additions & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ 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: {
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{fixStyle: 'inline-type-imports', disallowTypeAnnotations: false},
],
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
Expand All @@ -61,9 +62,18 @@ 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',

// not needed to be enforced for TS
'import/namespace': 'off',
},
},
{
Expand Down Expand Up @@ -128,7 +138,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 All @@ -146,6 +156,13 @@ module.exports = {
],
},
},
{
files: 'e2e/coverage-remapping/covered.ts',
rules: {
'no-constant-binary-expression': 'off',
'no-constant-condition': 'off',
},
},

// 'eslint-plugin-jest' rules for test and test related files
{
Expand All @@ -158,6 +175,7 @@ module.exports = {
'e2e/failures/macros.js',
'e2e/test-in-root/*.js',
'e2e/test-match/test-suites/*',
'e2e/test-match-default/dot-spec-tests/*',
'packages/test-utils/src/ConditionalTest.ts',
],
env: {'jest/globals': true},
Expand Down Expand Up @@ -207,6 +225,7 @@ module.exports = {
'jest/no-focused-tests': 'off',
'jest/require-to-throw-message': 'off',
'no-console': 'off',
'no-constant-condition': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'sort-keys': 'off',
Expand Down Expand Up @@ -272,6 +291,16 @@ module.exports = {
'no-restricted-imports': 'off',
},
},
{
files: ['examples/angular/**/*'],
rules: {
// Angular DI for some reason doesn't work with type imports
'@typescript-eslint/consistent-type-imports': [
'error',
{prefer: 'no-type-imports', disallowTypeAnnotations: false},
],
},
},
{
files: 'packages/**/*.ts',
rules: {
Expand Down Expand Up @@ -347,6 +376,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 +388,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 +405,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 +417,7 @@ module.exports = {
parserOptions: {
sourceType: 'module',
},
plugins: ['import', 'jsdoc'],
plugins: ['import', 'jsdoc', 'unicorn'],
rules: {
'accessor-pairs': ['warn', {setWithoutGet: true}],
'block-scoped-var': 'off',
Expand All @@ -407,6 +439,7 @@ module.exports = {
'handle-callback-err': 'off',
'id-length': 'off',
'id-match': 'off',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': [
'error',
{
Expand Down Expand Up @@ -464,7 +497,8 @@ module.exports = {
{allow: ['warn', 'error', 'time', 'timeEnd', 'timeStamp']},
],
'no-const-assign': 'error',
'no-constant-condition': 'off',
'no-constant-condition': 'error',
'no-constant-binary-expression': 'error',
'no-continue': 'off',
'no-control-regex': 'off',
'no-debugger': 'error',
Expand Down Expand Up @@ -590,6 +624,14 @@ 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/numeric-separators-style': '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"
}
]
}
7 changes: 6 additions & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ on:
schedule:
- cron: '0 0 * * *'

concurrency:
group: lock-threads

permissions: {}
jobs:
lock:
permissions:
issues: write # to lock issues (dessant/lock-threads)
pull-requests: write # to lock PRs (dessant/lock-threads)
discussions: write # to lock discussions (dessant/lock-threads)

runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
process-only: 'issues, prs'
issue-inactive-days: '30'
exclude-any-issue-labels: 'Discussion'
issue-comment: >
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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)
issues: write # to create an issue and comment in it

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

0 comments on commit 0bd6f1e

Please sign in to comment.