Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates jest/ts-jest to latest #9155

Merged
merged 8 commits into from
Oct 25, 2024
Merged

updates jest/ts-jest to latest #9155

merged 8 commits into from
Oct 25, 2024

Conversation

dimitropoulos
Copy link
Contributor

@dimitropoulos dimitropoulos commented Sep 16, 2024

Description

Note

there's a lot here, but I tried to make it easier to review by doing a good job of separating the different phases of the PR into their own commits - so for this one you'll probably have a much better review experience if you read commit-by-commit.

I noticed that we were getting lots of errors when running tests due to running an unsupported version of TypeScript (as compared to what our version of jest knew about). This is solved by updating our dependencies. Coincidentally, there's a good few reasons to upgrade anyway, so this comes at a good time.

  • update jest to latest
    • update snapshots to new syntax
  • update ts-jest to latest
    • update all jest configs to .ts files (fun fact, this hit a ts-node bug)
      • should not need an eslint override in every config for the default export
  • remove @types/jest and used @jest/globals directly
  • make sure all tests pass (prior to this PR there were some sinkers in the package tests)

Follow-ups after this PR

  • We have "lint": "eslint src/" in 16 packages, which skips the test files. Start linting tests (which, will involve fixing lints in tests).
  • Some of the mocks (e.g. get-turbo-upgrade-command.test.ts) are timing out on GitHub Actions, and we believe the cause is running out of I/O (which the tests do a lot of). Attempt to fix this by moving to an in-memory filesystem for tests.

Testing Instructions

run pnpm test

Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 5:08pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 5:08pm

@turbo-orchestrator turbo-orchestrator bot added area: examples Improvements or additions to examples created-by: turborepo pkg: create-turbo Issues related to npx create-turbo pkg: turbo-codemod pkg: turbo-eslint eslint-config-turbo and eslint-plugin-turbo pkg: turbo-gen pkg: turbo-ignore packages/turbo-ignore pkg: turbo-workspaces labels Sep 16, 2024
Copy link

socket-security bot commented Sep 16, 2024

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/jest@27.5.1, npm/ts-jest@27.1.5, npm/ts-jest@29.1.2

View full report↗︎

@dimitropoulos dimitropoulos force-pushed the dimitri/ts-jest-upgrade branch from 2f13ddd to adc2abd Compare September 17, 2024 00:41
@dimitropoulos dimitropoulos force-pushed the dimitri/ts-jest-upgrade branch from adc2abd to 24078b0 Compare October 8, 2024 22:14
@dimitropoulos dimitropoulos force-pushed the dimitri/ts-jest-upgrade branch from 24078b0 to a5e1d49 Compare October 8, 2024 22:23
@dimitropoulos dimitropoulos force-pushed the dimitri/ts-jest-upgrade branch from a5e1d49 to 609536c Compare October 9, 2024 22:12
@dimitropoulos dimitropoulos force-pushed the dimitri/ts-jest-upgrade branch from 609536c to 1c754ab Compare October 23, 2024 18:54
@dimitropoulos dimitropoulos force-pushed the dimitri/ts-jest-upgrade branch from 1c754ab to 2a98608 Compare October 24, 2024 14:39
@dimitropoulos dimitropoulos force-pushed the dimitri/ts-jest-upgrade branch from e159ce2 to 02749b3 Compare October 24, 2024 21:16
@dimitropoulos dimitropoulos changed the title [WIP] updates jest, ts-jest, and @types/jest to latest updates jest/ts-jest to latest Oct 24, 2024
@dimitropoulos dimitropoulos marked this pull request as ready for review October 24, 2024 21:34
@dimitropoulos dimitropoulos requested review from anthonyshew and a team as code owners October 24, 2024 21:34
@@ -356,9 +356,9 @@ mod test {
use crate::{task_graph::TaskDefinition, turbo_json::CONFIG_FILE};

#[test_case(r"{}", TurboJson::default() ; "empty")]
#[test_case(r#"{ "globalDependencies": ["tsconfig.json", "jest.config.js"] }"#,
#[test_case(r#"{ "globalDependencies": ["tsconfig.json", "jest.config.ts"] }"#,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unsure about this at first, but it seems to be happy. please double-check.

Copy link
Member

@tknickman tknickman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions but nothing blocking, thanks for tackling this!

packages/tsconfig/package.json Outdated Show resolved Hide resolved
packages/turbo-test-utils/src/validateLogs.ts Show resolved Hide resolved
examples/with-nestjs/packages/api/package.json Outdated Show resolved Hide resolved
@dimitropoulos dimitropoulos merged commit a9a0ef5 into main Oct 25, 2024
44 checks passed
@dimitropoulos dimitropoulos deleted the dimitri/ts-jest-upgrade branch October 25, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Improvements or additions to documentation area: examples Improvements or additions to examples pkg: create-turbo Issues related to npx create-turbo pkg: turbo-codemod pkg: turbo-eslint eslint-config-turbo and eslint-plugin-turbo pkg: turbo-gen pkg: turbo-ignore packages/turbo-ignore pkg: turbo-repository pkg: turbo-telemetry pkg: turbo-workspaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants