Skip to content

Commit 8eff2c5

Browse files
committed
incomplete fix
1 parent 783fc98 commit 8eff2c5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

packages/aws-cdk/test/api/environment/environment-resources.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,9 @@ describe('validateversion without bootstrap stack', () => {
101101
.spyOn(CachedDataSource.prototype as any, 'load')
102102
.mockImplementation(() => Promise.resolve({ expiration: 0, notices: [] }));
103103

104-
// mock cli version number
105-
jest.spyOn(version, 'versionNumber').mockImplementation(() => '1.0.0');
106-
107104
// THEN
108105
const ioHost = new FakeIoHost();
109-
const notices = Notices.create({ context: new Context(), ioHost });
106+
const notices = Notices.create({ context: new Context(), ioHost, cliVersion: '1.0.0' });
110107
await notices.refresh({ dataSource: { fetch: async () => [] } });
111108
await expect(envResources().validateVersion(8, '/abc')).resolves.toBeUndefined();
112109

packages/aws-cdk/test/context-providers/generic.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import * as contextproviders from '../../lib/context-providers';
44
import { Context, TRANSIENT_CONTEXT_KEY } from '../../lib/api/context';
55
import { MockSdkProvider, setDefaultSTSMocks } from '../util/mock-sdk';
66

7+
const ioHost = new TestIoHost();
8+
const ioHelper = ioHost.asHelper();
9+
710
const mockSDK = new MockSdkProvider();
811
setDefaultSTSMocks();
912

@@ -22,7 +25,7 @@ test('errors are reported into the context value', async () => {
2225
// WHEN
2326
await contextproviders.provideContextValues([
2427
{ key: 'asdf', props: { account: '1234', region: 'us-east-1' }, provider: TEST_PROVIDER },
25-
], context, mockSDK);
28+
], context, mockSDK, ioHelper);
2629

2730
// THEN - error is now in context
2831

@@ -59,7 +62,7 @@ test('lookup role ARN is resolved', async () => {
5962
},
6063
provider: TEST_PROVIDER,
6164
},
62-
], context, mockSDK);
65+
], context, mockSDK, ioHelper);
6366

6467
// THEN - Value gets resolved
6568
expect(context.get('asdf')).toEqual('some resolved value');
@@ -77,7 +80,7 @@ test('errors are marked transient', async () => {
7780
// WHEN
7881
await contextproviders.provideContextValues([
7982
{ key: 'asdf', props: { account: '1234', region: 'us-east-1' }, provider: TEST_PROVIDER },
80-
], context, mockSDK);
83+
], context, mockSDK, ioHelper);
8184

8285
// THEN - error is marked transient
8386
expect(context.get('asdf')[TRANSIENT_CONTEXT_KEY]).toBeTruthy();
@@ -98,7 +101,7 @@ test('context provider can be registered using PluginHost', async () => {
98101
// WHEN
99102
await contextproviders.provideContextValues([
100103
{ key: 'asdf', props: { account: '1234', region: 'us-east-1', pluginName: 'prov' }, provider: PLUGIN_PROVIDER },
101-
], context, mockSDK);
104+
], context, mockSDK, ioHelper);
102105

103106
// THEN - error is marked transient
104107
expect(called).toEqual(true);
@@ -116,7 +119,7 @@ test('plugin context provider can be called without account/region', async () =>
116119
// WHEN
117120
await contextproviders.provideContextValues([
118121
{ key: 'asdf', props: { banana: 'yellow', pluginName: 'prov' } as any, provider: PLUGIN_PROVIDER },
119-
], context, mockSDK);
122+
], context, mockSDK, ioHelper);
120123

121124
// THEN - error is marked transient
122125
expect(context.get('asdf')).toEqual('yay');

0 commit comments

Comments
 (0)