Skip to content

Commit

Permalink
WIP - add unit test to synthesis.test.ts
Browse files Browse the repository at this point in the history
Signed-off-by: Sumu <[email protected]>
  • Loading branch information
sumupitchayan committed Oct 23, 2024
1 parent 318eae6 commit c4e1795
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/aws-cdk-lib/core/test/synthesis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Construct } from 'constructs';
import * as cxschema from '../../cloud-assembly-schema';
import * as cxapi from '../../cx-api';
import * as cdk from '../lib';
import { Template } from '../../assertions';
import { synthesize } from '../lib/private/synthesis';

function createModernApp() {
Expand Down Expand Up @@ -362,6 +363,26 @@ describe('synthesis', () => {

});

test('can call synth multiple times without caching assembly', () => {
const app = new cdk.App();

const stages = [
{
stage: 'PROD',
},
{
stage: 'BETA',
},
];

stages.forEach(({ stage }) => {
const stack = new cdk.Stack(app, `${stage}-Stack`, {});
// Assert that `Unable to find artifact with id` error is not thrown
expect(() => {
Template.fromStack(stack);
}).not.toThrow();
});
});
});

function list(outdir: string) {
Expand Down

0 comments on commit c4e1795

Please sign in to comment.