Skip to content
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 examples/typescript/aws-cloudfront-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/aws-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/aws-kubernetes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/aws-move/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/aws-multiple-stacks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"upgrade:next": "npm i cdktn@next cdktn-cli@next"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "18.11.19",
"ts-node": "10.9.1",
"typescript": "5.4.5"
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/aws-prebuilt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"synth": "cdktn synth"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/azure-app-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"jest": "^29.7.0",
"ts-jest": "29.2.5",
"jest": "^30.3.0",
"ts-jest": "29.4.9",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/azure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/backends/azurerm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "^10.9.1",
"typescript": "^5.7.3"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/backends/cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "^10.9.1",
"typescript": "^5.7.3"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/backends/gcs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "^10.9.1",
"typescript": "^5.7.3"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/backends/remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "^10.9.1",
"typescript": "^5.7.3"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/backends/s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "^10.9.1",
"typescript": "^5.7.3"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"tsx": "4.6.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/google-cloudrun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktf-cli": "0.21.0",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/google/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/kubernetes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/provisioner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/ucloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/vault/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"constructs": "10.4.2"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/node": "20.17.51",
"cdktn-cli": "0.0.0",
"jest": "^29.7.0",
"jest": "^30.3.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/@cdktn/cli-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@types/fs-extra": "8.1.5",
"@types/ink": "2.0.3",
"@types/ink-spinner": "3.0.5",
"@types/jest": "29.5.14",
"@types/jest": "30.0.0",
"@types/json-schema": "7.0.15",
"@types/lodash.isequal": "4.5.8",
"@types/nock": "11.1.0",
Expand All @@ -127,10 +127,10 @@
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"prettier": "2.8.8",
"jest": "^29.7.0",
"jest": "^30.3.0",
"nock": "13.5.6",
"react": "18.3.1",
"ts-jest": "29.4.6",
"ts-jest": "29.4.9",
"tsc-files": "1.1.4",
"typescript": "5.4.5",
"typescript-eslint": "^8.57.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("prebuilt-providers", () => {

await expect(
getAllPrebuiltProviderVersions("@cdktf/test"),
).rejects.toThrowError("Connection error");
).rejects.toThrow("Connection error");
});

it("fails when npm responds with 5xx", async () => {
Expand All @@ -91,7 +91,7 @@ describe("prebuilt-providers", () => {

await expect(
getAllPrebuiltProviderVersions("@cdktf/test"),
).rejects.toThrowError(/Unexpected error/);
).rejects.toThrow(/Unexpected error/);
});

it("fails when package doesn't exist", async () => {
Expand All @@ -101,7 +101,7 @@ describe("prebuilt-providers", () => {

await expect(
getAllPrebuiltProviderVersions("@cdktf/test"),
).rejects.toThrowError(/not found/i);
).rejects.toThrow(/not found/i);
});

it("succeeds when package found", async () => {
Expand Down Expand Up @@ -181,7 +181,7 @@ describe("prebuilt-providers", () => {

await expect(
getNpmPackageName(ProviderConstraint.fromConfigEntry("test"), false),
).rejects.toThrowError("Connection error");
).rejects.toThrow("Connection error");
});

it("succeeds when cdk.tf redirect and Github work", async () => {
Expand Down Expand Up @@ -227,7 +227,7 @@ describe("prebuilt-providers", () => {
ProviderConstraint.fromConfigEntry("test"),
"0.12.2",
),
).rejects.toThrowError("Connection error");
).rejects.toThrow("Connection error");
});

it("returns null on connection error with npm", async () => {
Expand All @@ -246,7 +246,7 @@ describe("prebuilt-providers", () => {
ProviderConstraint.fromConfigEntry("test"),
"0.12.2",
),
).rejects.toThrowError("Connection error");
).rejects.toThrow("Connection error");
});

it("succeeds when both cdk.tf and npm work", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import path from "path";
import * as fs from "fs-extra";
import os from "os";
import { EventEmitter } from "events";
import { CdktfProject, init, get } from "../../lib/index";
import { spawn } from "cross-spawn";
import { exec, Language } from "@cdktn/commons";
Expand All @@ -32,11 +33,21 @@ jest.mock("@cdktn/commons", () => {
jest.mock("cross-spawn", () => {
return {
spawn: jest.fn().mockImplementation((_file, _args) => {
return {
onData: () => undefined,
onExit: (listener: any) => listener({ exitCode: 0 }), // immediately fake a successful termination
const child = new EventEmitter() as EventEmitter & {
stdout: EventEmitter;
stdin: { write: () => void };
kill: () => void;
};

child.stdout = new EventEmitter();
child.stdin = {
write: () => undefined,
};
child.kill = () => undefined;

setImmediate(() => child.emit("close", 0));

return child;
Comment thread
jsteinich marked this conversation as resolved.
Resolved
}),
};
});
Expand Down
Loading
Loading