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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/turborepo-lib/src/turbo_json/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.

TurboJson {
global_deps: vec!["jest.config.js".to_string(), "tsconfig.json".to_string()],
global_deps: vec!["jest.config.ts".to_string(), "tsconfig.json".to_string()],
..TurboJson::default()
}
; "global dependencies (sorted)")]
Expand Down
2 changes: 1 addition & 1 deletion docs/repo-docs/reference/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Specify glob of global filesystem dependencies to be hashed. Useful for `.env` a

```bash title="Terminal"
turbo run build --global-deps=".env"
turbo run build --global-deps=".env.*" --global-deps=".eslintrc" --global-deps="jest.config.js"
turbo run build --global-deps=".env.*" --global-deps=".eslintrc" --global-deps="jest.config.ts"
```

<Callout type="info">
Expand Down
2 changes: 1 addition & 1 deletion examples/kitchen-sink/apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"morgan": "^1.10.0"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@repo/eslint-config": "workspace:*",
"@repo/jest-presets": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/body-parser": "^1.19.5",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/morgan": "^1.9.9",
"@types/node": "^20.11.24",
"@types/supertest": "^6.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import supertest from "supertest";
import { describe, it, expect } from "@jest/globals";
import { createServer } from "../server";

describe("Server", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
import type { Config } from "jest";

const config = {
roots: ["<rootDir>"],
testEnvironment: "jsdom",
transform: {
Expand All @@ -11,4 +13,6 @@ module.exports = {
"<rootDir>/dist",
],
preset: "ts-jest",
};
} as const satisfies Config;

export default config;
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
import type { Config } from "jest";

const config = {
roots: ["<rootDir>"],
transform: {
"^.+\\.tsx?$": "ts-jest",
Expand All @@ -10,4 +12,6 @@ module.exports = {
"<rootDir>/dist",
],
preset: "ts-jest",
};
} as const satisfies Config;

export default config;
9 changes: 5 additions & 4 deletions examples/kitchen-sink/packages/jest-presets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"private": true,
"license": "MIT",
"files": [
"browser/jest-preset.js",
"node/jest-preset.js"
"browser/jest-preset.ts",
"node/jest-preset.ts"
],
"dependencies": {
"ts-jest": "^29.1.2"
"jest": "^29.7.0",
"ts-jest": "^29.2.5"
},
"devDependencies": {
"jest-environment-jsdom": "^29.7.0"
}
}
}
2 changes: 1 addition & 1 deletion examples/kitchen-sink/packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"preset": "@repo/jest-presets/node"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@repo/eslint-config": "workspace:*",
"@repo/jest-presets": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.24",
"jest": "^29.7.0",
"tsup": "^8.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect, jest } from "@jest/globals";
import { log } from "..";

jest.spyOn(global.console, "log");
Expand Down
2 changes: 1 addition & 1 deletion examples/kitchen-sink/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"preset": "@repo/jest-presets/browser"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@repo/eslint-config": "workspace:*",
"@repo/jest-presets": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.24",
"@types/react": "^18.2.62",
"@types/react-dom": "^18.2.19",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it } from "@jest/globals";
import { createRoot } from "react-dom/client";
import { CounterButton } from ".";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it } from "@jest/globals";
import { createRoot } from "react-dom/client";
import { Link } from ".";

Expand Down
30 changes: 13 additions & 17 deletions examples/kitchen-sink/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/with-docker/apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"morgan": "^1.10.0"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@repo/eslint-config": "*",
"@repo/jest-presets": "*",
"@repo/typescript-config": "*",
"@types/body-parser": "^1.19.5",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/morgan": "^1.9.9",
"@types/node": "^20.11.24",
"@types/supertest": "^6.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import supertest from "supertest";
import { describe, it, expect } from "@jest/globals";
import { createServer } from "../server";

describe("server", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
import type { Config } from "jest";

const config = {
roots: ["<rootDir>"],
transform: {
"^.+\\.tsx?$": "ts-jest",
Expand All @@ -10,4 +12,6 @@ module.exports = {
"<rootDir>/dist",
],
preset: "ts-jest",
};
} as const satisfies Config;

export default config;
7 changes: 4 additions & 3 deletions examples/with-docker/packages/jest-presets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"private": true,
"license": "MIT",
"files": [
"node/jest-preset.js"
"node/jest-preset.ts"
],
"dependencies": {
"ts-jest": "^29.1.1"
"jest": "^29.7.0",
"ts-jest": "^29.2.5"
}
}
}
2 changes: 1 addition & 1 deletion examples/with-docker/packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"preset": "@repo/jest-presets/node"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@repo/eslint-config": "*",
"@repo/jest-presets": "*",
"@repo/typescript-config": "*",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.24",
"eslint": "^8.57.0",
"jest": "^29.7.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect, jest } from "@jest/globals";
import { log } from "..";

jest.spyOn(global.console, "log");
Expand Down
Loading
Loading