Skip to content

Commit

Permalink
Merge branch 'main' into improve-detect
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 19, 2023
2 parents 5732328 + ea685a5 commit 319180c
Show file tree
Hide file tree
Showing 2,468 changed files with 49,746 additions and 50,513 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ aliases:
app-dir: ~/jest

orbs:
node: circleci/node@5.0.3
node: circleci/node@5.1.0

jobs:
test-node:
Expand Down Expand Up @@ -58,5 +58,6 @@ workflows:
name: test-node-partial-<< matrix.node-version >>
matrix:
parameters:
node-version: ['14', '16', '18']
# For some reason, v20 fails to run yarn install…
node-version: ['16', '18']
- test-jest-jasmine
2 changes: 1 addition & 1 deletion .eslintplugin/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
23 changes: 19 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -128,7 +128,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 @@ -235,6 +235,15 @@ module.exports = {
'jest/prefer-to-have-length': 'off',
},
},
// snapshot in an example needs to keep escapes
{
files: [
'**/2017-02-21-jest-19-immersive-watch-mode-test-platform-improvements.md/**',
],
rules: {
'no-useless-escape': 'off',
},
},

// snapshots in examples plus inline snapshots need to keep backtick
{
Expand Down Expand Up @@ -348,7 +357,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 Down Expand Up @@ -376,7 +385,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 @@ -581,6 +590,12 @@ module.exports = {
'wrap-iife': 'off',
'wrap-regex': 'off',
yoda: 'off',

'unicorn/explicit-length-check': '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: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"lockFileMaintenance": {"enabled": true, "automerge": false},
"rangeStrategy": "replace",
"postUpdateOptions": ["yarnDedupeHighest"],
"packageRules": [
{
"matchPackageNames": ["@tsd/typescript", "typescript"],
"groupName": "typescript"
},
{
"matchPackageNames": ["jest-runner-tsd", "tsd-lite"],
"groupName": "tsd"
}
]
}
8 changes: 5 additions & 3 deletions .github/workflows/close-stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '*/10 * * * *'
- cron: '0 * * * *'

permissions:
issues: write # to close stale issues (actions/stale)
Expand All @@ -12,7 +12,7 @@ jobs:
name: 'Close month old issues and PRs'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6
- uses: actions/stale@v8
with:
start-date: '2022-01-01T00:00:00Z'
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.'
Expand All @@ -25,13 +25,14 @@ jobs:
days-before-pr-close: 30
exempt-all-milestones: true
exempt-issue-labels: Pinned
exempt-pr-labels: Pinned
exempt-draft-pr: true
operations-per-run: 1750
stale-legacy:
name: 'Close year old issues and PRs'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6
- uses: actions/stale@v8
with:
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.'
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.'
Expand All @@ -43,4 +44,5 @@ jobs:
days-before-pr-close: 30
exempt-all-milestones: true
exempt-issue-labels: Pinned
exempt-pr-labels: Pinned
operations-per-run: 1750
20 changes: 10 additions & 10 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
name: Questions
runs-on: ubuntu-latest
steps:
- name: Close Issue
uses: peter-evans/close-issue@v2
if: "${{ github.event.label.name == ':speech_balloon: Question' }}"
with:
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.
- if: "${{ github.event.label.name == ':speech_balloon: Question' }}"
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."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}
bug-without-repro:
name: Bug reports without reproductions
runs-on: ubuntu-latest
steps:
- name: Close Issue
uses: peter-evans/close-issue@v2
if: "${{ github.event.label.name == 'Needs Reproduction' }}"
with:
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.
- if: "${{ github.event.label.name == 'Needs Reproduction' }}"
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."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
- uses: dessant/lock-threads@v4
with:
github-token: ${{ github.token }}
issue-inactive-days: '30'
Expand Down
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 }}
Loading

0 comments on commit 319180c

Please sign in to comment.