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
13,304 changes: 8,207 additions & 5,097 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"eslint": "^9.39.2",
"eslint-plugin-custom-rules": "file:tools/eslint",
"gh-pages": "^6.3.0",
"jest": "^29.7.0",
"jest": "30.2.0",
"prettier": "^3.8.1",
"serve": "^14.2.5",
"ts-jest": "^29.4.6",
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/acm/__snapshots__/certificate.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuCertificate class should create a new certificate (which requires manual DNS changes) if hosted zone ids are not provided 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuApiGateway5xxPercentageAlarm construct should create the correct alarm resource with minimal config 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuAlb4xxPercentageAlarm construct should create the correct alarm resource with minimal config 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`GuLambdaThrottlingAlarm construct should match snapshot 1`] = `
{
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/dns/__snapshots__/dns-records.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuCname construct should create the correct resources with minimal config 1`] = `
{
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/dns/dns-records.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("The GuDnsRecordSet construct", () => {
resourceRecords: ["apple.example.com", "banana.example.com"],
ttl: Duration.hours(1),
});
}).toThrowError(
}).toThrow(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.toThrowError has been deprecated in favour of .toThrow.

"According to RFC, a CNAME record should not return multiple answers. Doing so may cause problems during resolution.",
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/ecs/__snapshots__/ecs-task.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuEcsTask pattern should create the correct resources with lots of config 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuFastlyLogsIamRole construct correctly wires up the policy 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuJanusAssumableRole construct creates multiple roles in the same stack 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuLogShippingPolicy singleton class will only be defined once in a stack, even when attached to multiple roles 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GitHubActionsRole construct should create the correct resources with minimal config 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuInstanceRole construct should allow additional policies to be specified 1`] = `
{
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/s3/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuS3Bucket construct should set the bucket's policy to 'retain' 1`] = `
{
Expand Down
6 changes: 2 additions & 4 deletions src/constructs/ses/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ describe("The GuEmailIdentity construct", () => {
domainName: validDomain,
app: `test-${index}`,
});
}).not.toThrowError();
}).not.toThrow();
});

expect(() => {
new GuEmailIdentity(stack, "MyEmailIdentity", {
domainName: "my-service.theguardian.com",
app: "test",
});
}).toThrowError(
"Auto verification is only supported for certain domains. my-service.theguardian.com is not supported.",
);
}).toThrow("Auto verification is only supported for certain domains. my-service.theguardian.com is not supported.");
});

it("should create DKIM CNAME records as required to verify the EmailIdentity", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/vpc/__snapshots__/vpc.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuVpc construct should match snapshot 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuFastlyKinesisLogRole construct correctly wires up the policy 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuEc2AppExperimental pattern matches the snapshot 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuKinesisLambda pattern should create the correct resources for a new stack with minimal config 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuSnsLambda pattern should create the correct resources for a new stack with minimal config 1`] = `
{
Expand Down
6 changes: 3 additions & 3 deletions src/experimental/patterns/ec2-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ describe("The GuEc2AppExperimental pattern", () => {

expect(() => {
cdkApp.synth();
}).toThrowError(
}).toThrow(
"Failed to detect the autoscaling group relating to the scaling policy on path test/ScaleOut. Was it created in the scope of a GuAutoScalingGroup?",
);
});
Expand Down Expand Up @@ -464,14 +464,14 @@ describe("The GuEc2AppExperimental pattern", () => {
const stack = simpleGuStackForTesting({ env: { region: "eu-west-1" } });
expect(() => {
new GuEc2AppExperimental(stack, { ...initialProps(stack), slowStartDuration: Duration.seconds(29) });
}).toThrowError("Slow start duration must be between 30 and 900 seconds");
}).toThrow("Slow start duration must be between 30 and 900 seconds");
});

it("should throw an error if the slow start value is too high", () => {
const stack = simpleGuStackForTesting({ env: { region: "eu-west-1" } });
expect(() => {
new GuEc2AppExperimental(stack, { ...initialProps(stack), slowStartDuration: Duration.seconds(901) });
}).toThrowError("Slow start duration must be between 30 and 900 seconds");
}).toThrow("Slow start duration must be between 30 and 900 seconds");
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/patterns/__snapshots__/api-lambda.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuApiLambda pattern should allow us to link a domain name to a LambdaRestApi 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuApiGatewayWithLambdaByPath pattern should create the correct resources with minimal config 1`] = `
{
Expand Down
2 changes: 1 addition & 1 deletion src/patterns/__snapshots__/scheduled-lambda.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuScheduledLambda pattern should create the correct resources with an input in the rule 1`] = `
{
Expand Down
2 changes: 1 addition & 1 deletion src/patterns/ec2-app/__snapshots__/base.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`the GuEC2App pattern can produce a restricted EC2 app locked to specific CIDR ranges 1`] = `
{
Expand Down
12 changes: 6 additions & 6 deletions src/patterns/ec2-app/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ describe("the GuEC2App pattern", function () {
instanceMetricGranularity: "5Minute",
userData: UserData.forLinux(),
}),
).toThrowError(
).toThrow(
"Restricted apps cannot be globally accessible. Adjust CIDR ranges (0.0.0.0/0, 1.2.3.4/32) or use Public.",
);
});
Expand All @@ -378,7 +378,7 @@ describe("the GuEC2App pattern", function () {
instanceMetricGranularity: "5Minute",
userData: UserData.forLinux(),
}),
).toThrowError(
).toThrow(
"Internal apps should only be accessible on 10. ranges. Adjust CIDR ranges (93.1.2.3/12) or use Restricted.",
);
});
Expand Down Expand Up @@ -851,7 +851,7 @@ UserData from accessed construct`);
withoutLogShipping: true,
},
});
}).toThrowError(
}).toThrow(
"Application logging has been enabled (via the `applicationLogging` prop) but your `roleConfiguration` sets " +
"`withoutLogShipping` to true. Please turn off application logging or remove `withoutLogShipping`",
);
Expand Down Expand Up @@ -949,7 +949,7 @@ UserData from accessed construct`);
allowedGroups: [],
},
}),
).toThrowError("googleAuth.allowedGroups cannot be empty!");
).toThrow("googleAuth.allowedGroups cannot be empty!");
});

it("throws when googleAuth.sessionTimeoutInMinutes is > 60", () => {
Expand Down Expand Up @@ -979,7 +979,7 @@ UserData from accessed construct`);
sessionTimeoutInMinutes: 61,
},
}),
).toThrowError("googleAuth.sessionTimeoutInMinutes must be <= 60!");
).toThrow("googleAuth.sessionTimeoutInMinutes must be <= 60!");
});

it("throws when googleAuth.allowedGroups contains groups using non-standard domains", () => {
Expand Down Expand Up @@ -1009,7 +1009,7 @@ UserData from accessed construct`);
allowedGroups: ["apple@guardian.co.uk", "engineering@theguardian.com"],
},
}),
).toThrowError("googleAuth.allowedGroups must use the @guardian.co.uk domain.");
).toThrow("googleAuth.allowedGroups must use the @guardian.co.uk domain.");
});

it("should provides a default healthcheck", function () {
Expand Down
4 changes: 2 additions & 2 deletions src/riff-raff-yaml-file/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe("The RiffRaffYamlFile class", () => {

expect(() => {
new RiffRaffYamlFile(app);
}).toThrowError("Unable to produce a working riff-raff.yaml file; missing 1 definitions"); // Stack of media-service has no CODE stage
}).toThrow("Unable to produce a working riff-raff.yaml file; missing 1 definitions"); // Stack of media-service has no CODE stage
});

it("Should throw if there is an unresolved region", () => {
Expand All @@ -191,7 +191,7 @@ describe("The RiffRaffYamlFile class", () => {

expect(() => {
new RiffRaffYamlFile(app);
}).toThrowError("Unable to produce a working riff-raff.yaml file; all stacks must have an explicit region set");
}).toThrow("Unable to produce a working riff-raff.yaml file; all stacks must have an explicit region set");
});

it("Should add a cloud-formation deployment", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/types/access.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("AppAccess.validate", () => {
scope: AccessScope.RESTRICTED,
cidrRanges: [Peer.ipv4("1.2.3.4/21"), Peer.ipv4("10.0.0.0/0")],
});
}).not.toThrowError();
}).not.toThrow();
});

it("should not allow RestrictedAccess to grant global access", () => {
Expand All @@ -18,7 +18,7 @@ describe("AppAccess.validate", () => {
scope: AccessScope.RESTRICTED,
cidrRanges: [Peer.ipv4("1.2.3.4/21"), Peer.anyIpv4()],
});
}).toThrowError(
}).toThrow(
`Restricted apps cannot be globally accessible. Adjust CIDR ranges (1.2.3.4/21, 0.0.0.0/0) or use Public.`,
);
});
Expand All @@ -29,7 +29,7 @@ describe("AppAccess.validate", () => {
scope: AccessScope.INTERNAL,
cidrRanges: [Peer.ipv4("10.0.0.0/0")],
});
}).not.toThrowError();
}).not.toThrow();
});

it("should not allow InternalAccess to grant external access", () => {
Expand All @@ -38,7 +38,7 @@ describe("AppAccess.validate", () => {
scope: AccessScope.INTERNAL,
cidrRanges: [Peer.ipv4("10.0.0.0/0"), Peer.ipv4("1.2.3.4/21")],
});
}).toThrowError(
}).toThrow(
`Internal apps should only be accessible on 10. ranges. Adjust CIDR ranges (10.0.0.0/0, 1.2.3.4/21) or use Restricted.`,
);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`The GuAppAwareConstruct mixin should add the app tag 1`] = `
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/mixin/app-aware-contruct.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("The GuAppAwareConstruct mixin", () => {

expect(() => {
new TestConstruct(stack, "MyBucket", {});
}).toThrowError("Cannot use the GuAppAwareConstruct mixin without an AppIdentity");
}).toThrow("Cannot use the GuAppAwareConstruct mixin without an AppIdentity");
});

it("should suffix the id with the app identifier", () => {
Expand Down
Loading