Skip to content

Commit

Permalink
remove explicit testing of GuStageParameter and GuStackParameter
Browse files Browse the repository at this point in the history
A GuParameter now relies on a function from GuStack, as GuStageParameter and GuStackParameter are automatically added to a GuStack, we cannot explicitly test them now as its recursuve.

Remove them in favour of a slightly implicit test in stack.test.ts.
  • Loading branch information
akash1810 committed Feb 17, 2021
1 parent 8dff3e9 commit dcac71d
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/constructs/core/parameters.test.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import "@aws-cdk/assert/jest";
import { SynthUtils } from "@aws-cdk/assert/lib/synth-utils";
import { Stack } from "@aws-cdk/core";
import { simpleGuStackForTesting } from "../../../test/utils";
import type { SynthedStack } from "../../../test/utils";
import { Stage, Stages } from "../../constants";
import {
GuAmiParameter,
GuArnParameter,
GuInstanceTypeParameter,
GuParameter,
GuS3ObjectArnParameter,
GuStackParameter,
GuStageParameter,
GuStringParameter,
GuSubnetListParameter,
GuVpcParameter,
} from "./parameters";
import type { GuStack } from "./stack";

describe("The GuParameter class", () => {
it("sets the type as passed through by default", () => {
Expand Down Expand Up @@ -84,39 +79,6 @@ describe("The GuStringParameter class", () => {
});
});

describe("The GuStageParameter class", () => {
it("should set the values as required", () => {
const stack = new Stack() as GuStack;

new GuStageParameter(stack);

const json = SynthUtils.toCloudFormation(stack) as SynthedStack;

expect(json.Parameters.Stage).toEqual({
Type: "String",
Description: "Stage name",
AllowedValues: Stages,
Default: Stage.CODE,
});
});
});

describe("The GuStackParameter class", () => {
it("should set the values as required", () => {
const stack = new Stack() as GuStack;

new GuStackParameter(stack);

const json = SynthUtils.toCloudFormation(stack) as SynthedStack;

expect(json.Parameters.Stack).toEqual({
Type: "String",
Description: "Name of this stack",
Default: "deploy",
});
});
});

describe("The GuInstanceTypeParameter class", () => {
it("should combine default, override and prop values", () => {
const stack = simpleGuStackForTesting();
Expand Down

0 comments on commit dcac71d

Please sign in to comment.