-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as cdk from 'aws-cdk-lib'; | ||
import { Template } from 'aws-cdk-lib/assertions'; | ||
|
||
/** | ||
* Remove hashed asset values and put a normalized name in instead. | ||
*/ | ||
export function normalizedTemplateFromStack(stack: cdk.Stack): Template { | ||
const templateWithRandomKeys = Template.fromStack(stack); | ||
Check failure on line 8 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 8 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
const templateWithConstKeys = JSON.parse( | ||
Check failure on line 9 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 9 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
JSON.stringify(templateWithRandomKeys.toJSON()).replace( | ||
Check failure on line 10 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 10 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
/[a-z0-9]{64}\.(zip|sh)/g, | ||
Check failure on line 11 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 11 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
'arbitrary-file.ext' | ||
Check failure on line 12 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 12 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
) | ||
Check failure on line 13 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 13 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
); | ||
Check failure on line 14 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 14 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
|
||
return templateWithConstKeys; | ||
Check failure on line 16 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
Check failure on line 16 in test/util.ts GitHub Actions / Run-CDK-Tests (16.x)
|
||
} |