Skip to content

Commit

Permalink
updates jest/ts-jest to latest (#9155)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos authored Oct 25, 2024
1 parent ddf7316 commit a9a0ef5
Show file tree
Hide file tree
Showing 116 changed files with 2,117 additions and 1,940 deletions.
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"] }"#,
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
1 change: 1 addition & 0 deletions examples/kitchen-sink/packages/ui/src/link/index.test.tsx
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
1 change: 1 addition & 0 deletions examples/with-docker/apps/api/src/__tests__/server.test.ts
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

0 comments on commit a9a0ef5

Please sign in to comment.