Skip to content

Commit

Permalink
Test right logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rix0rrr committed Feb 28, 2025
1 parent 14458da commit 4554c5c
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions packages/aws-cdk/test/cli/cdk-toolkit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,32 @@ describe('deploy', () => {
});
});

test('uses display names to reference assets', async () => {
// GIVEN
cloudExecutable = new MockCloudExecutable({
stacks: [MockStack.MOCK_STACK_WITH_ASSET],
});
const toolkit = new CdkToolkit({
cloudExecutable,
configuration: cloudExecutable.configuration,
sdkProvider: cloudExecutable.sdkProvider,
deployments: new FakeCloudFormation({}),
});
stderrMock.mockImplementation((...x) => {
console.error(...x);
});

// WHEN
await toolkit.deploy({
selector: { patterns: [MockStack.MOCK_STACK_WITH_ASSET.stackName] },
hotswap: HotswapMode.FULL_DEPLOYMENT,
});

// THEN
expect(stderrMock).toHaveBeenCalledWith(expect.stringContaining('Building Asset Display Name'));
expect(stderrMock).toHaveBeenCalledWith(expect.stringContaining('Publishing Asset Display Name (desto)'));
});

test('with stacks all stacks specified as wildcard', async () => {
// GIVEN
const toolkit = defaultToolkitSetup();
Expand Down Expand Up @@ -1640,10 +1666,16 @@ class MockStack {
version: Manifest.version(),
files: {
xyz: {
displayName: 'Asset Display Name',
source: {
path: path.resolve(__dirname, '..', 'LICENSE'),
path: path.resolve(__dirname, '..', '..', 'LICENSE'),
},
destinations: {
desto: {
bucketName: 'some-bucket',
objectKey: 'some-key',
},
},
destinations: {},
},
},
},
Expand Down

0 comments on commit 4554c5c

Please sign in to comment.