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/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

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