Skip to content

Commit

Permalink
kind of a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizencc committed Sep 11, 2024
1 parent 5d7ca50 commit 0c075f0
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/aws-cdk/test/cdk-toolkit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import { Template } from '../lib/api/util/cloudformation';
import { CdkToolkit, Tag } from '../lib/cdk-toolkit';
import { RequireApproval } from '../lib/diff';
import { flatten } from '../lib/util';
import { Configuration } from '../lib/settings';

let cloudExecutable: MockCloudExecutable;
let bootstrapper: jest.Mocked<Bootstrapper>;
Expand Down Expand Up @@ -115,7 +116,6 @@ describe('readCurrentTemplate', () => {
let mockForEnvironment = jest.fn();
let mockCloudExecutable: MockCloudExecutable;
beforeEach(() => {

template = {
Resources: {
Func: {
Expand Down Expand Up @@ -394,6 +394,29 @@ describe('readCurrentTemplate', () => {
});
});

describe('bootstrap', () => {
test('accepts qualifier from context', async () => {
// GIVEN
const toolkit = defaultToolkitSetup();
const configuration = new Configuration();
configuration.context.set('@aws-cdk/core:bootstrapQualifier', 'abcde');

// WHEN
await toolkit.bootstrap(['aws://56789/south-pole'], bootstrapper, {
parameters: {
qualifier: configuration.context.get('@aws-cdk/core:bootstrapQualifier'),
},
});

// THEN
expect(bootstrapper.bootstrapEnvironment).toHaveBeenCalledWith(expect.anything(), expect.anything(), {
parameters: {
qualifier: 'abcde',
},
});
});
});

describe('deploy', () => {
test('fails when no valid stack names are given', async () => {
// GIVEN
Expand Down

0 comments on commit 0c075f0

Please sign in to comment.