Skip to content

Commit ac111eb

Browse files
committed
Update mocks
1 parent a5226ac commit ac111eb

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

packages/@aws-cdk/integ-runner/test/engines/toolkit-lib-snapshot-path.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ describe('ToolkitLibRunnerEngine - Snapshot Path Handling', () => {
2525

2626
engine = new ToolkitLibRunnerEngine({
2727
workingDirectory: '/test/dir',
28+
region: 'us-dummy-1',
2829
});
2930
});
3031

3132
it('should use fromAssemblyDirectory when app is a path to existing snapshot directory', async () => {
3233
const snapshotPath = 'test.snapshot';
3334
const fullSnapshotPath = path.join('/test/dir', snapshotPath);
3435
const mockCx = { produce: jest.fn() };
35-
const mockLock = { dispose: jest.fn() };
36+
const mockLock = { dispose: jest.fn(), cloudAssembly: { stacksRecursively: [] } };
3637

3738
// Mock fs to indicate the snapshot directory exists
3839
mockedFs.pathExistsSync.mockReturnValue(true);
@@ -55,7 +56,7 @@ describe('ToolkitLibRunnerEngine - Snapshot Path Handling', () => {
5556
it('should use fromCdkApp when app is not a path to existing directory', async () => {
5657
const appCommand = 'node bin/app.js';
5758
const mockCx = { produce: jest.fn() };
58-
const mockLock = { dispose: jest.fn() };
59+
const mockLock = { dispose: jest.fn(), cloudAssembly: { stacksRecursively: [] } };
5960

6061
// Mock fs to indicate the path doesn't exist
6162
mockedFs.pathExistsSync.mockReturnValue(false);
@@ -76,7 +77,7 @@ describe('ToolkitLibRunnerEngine - Snapshot Path Handling', () => {
7677
const appPath = 'app.js';
7778
const fullAppPath = path.join('/test/dir', appPath);
7879
const mockCx = { produce: jest.fn() };
79-
const mockLock = { dispose: jest.fn() };
80+
const mockLock = { dispose: jest.fn(), cloudAssembly: { stacksRecursively: [] } };
8081

8182
// Mock fs to indicate the path exists but is not a directory
8283
mockedFs.pathExistsSync.mockReturnValue(true);

packages/@aws-cdk/integ-runner/test/engines/toolkit-lib.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ describe('ToolkitLibRunnerEngine', () => {
2525

2626
engine = new ToolkitLibRunnerEngine({
2727
workingDirectory: '/test/dir',
28+
region: 'us-dummy-1',
2829
});
2930
});
3031

3132
describe('synth', () => {
3233
it('should call toolkit.synth with correct parameters', async () => {
3334
const mockCx = { produce: jest.fn() };
34-
const mockLock = { dispose: jest.fn() };
35+
const mockLock = { dispose: jest.fn(), cloudAssembly: { stacksRecursively: [] } };
3536
mockToolkit.fromCdkApp.mockResolvedValue(mockCx as any);
3637
mockToolkit.synth.mockResolvedValue(mockLock as any);
3738

@@ -56,7 +57,7 @@ describe('ToolkitLibRunnerEngine', () => {
5657
describe('synthFast', () => {
5758
it('should use fromCdkApp and produce for fast synthesis', async () => {
5859
const mockCx = { produce: jest.fn() };
59-
const mockLock = { dispose: jest.fn() };
60+
const mockLock = { dispose: jest.fn(), cloudAssembly: { stacksRecursively: [] } };
6061
mockCx.produce.mockResolvedValue(mockLock);
6162
mockToolkit.fromCdkApp.mockResolvedValue(mockCx as any);
6263

@@ -221,6 +222,7 @@ describe('ToolkitLibRunnerEngine', () => {
221222
const engineWithOutput = new ToolkitLibRunnerEngine({
222223
workingDirectory: '/test',
223224
showOutput: true,
225+
region: 'us-dummy-1',
224226
});
225227

226228
expect(MockedToolkit).toHaveBeenCalledWith(expect.objectContaining({

0 commit comments

Comments
 (0)