Skip to content

Commit 29b9832

Browse files
committed
fix: broken test config
1 parent 3b865d7 commit 29b9832

File tree

5 files changed

+24
-502
lines changed

5 files changed

+24
-502
lines changed

packages/amplify-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
],
165165
"collectCoverage": true,
166166
"setupFilesAfterEnv": [
167-
"<rootDir>/src/commands/gen2-migration/refactor/generators/setup-jest.ts"
167+
"<rootDir>/src/__tests__/commands/gen2-migration/refactor/generators/setup-jest.ts"
168168
]
169169
},
170170
"amplify": {

packages/amplify-cli/src/__tests__/commands/gen2-migration/refactor/generators/custom-test-matchers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,13 @@ declare global {
5050
}
5151
}
5252
}
53+
54+
it('should pass', () => {
55+
expect(
56+
toBeACloudFormationCommand(
57+
[new DescribeStackResourcesCommand({ StackName: 'stackName' })],
58+
{ StackName: 'stackName' },
59+
DescribeStackResourcesCommand,
60+
),
61+
).toBeTruthy();
62+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { expect } from '@jest/globals';
22
import { toBeACloudFormationCommand } from './custom-test-matchers';
3+
import { DescribeStackResourcesCommand } from '@aws-sdk/client-cloudformation';
34

45
expect.extend({
56
toBeACloudFormationCommand,
67
});
8+
9+
it('sets up toBeACloudFormationCommand', () => {
10+
expect(
11+
toBeACloudFormationCommand(
12+
[new DescribeStackResourcesCommand({ StackName: 'stackName' })],
13+
{ StackName: 'stackName' },
14+
DescribeStackResourcesCommand,
15+
),
16+
).toBeTruthy();
17+
});

packages/amplify-cli/src/__tests__/commands/gen2-migration/refactor/generators/template-generator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ jest.mock('@aws-sdk/client-cloudformation', () => {
234234
});
235235

236236
jest.mock('node:fs/promises');
237-
jest.mock('./migration-readme-generator', () => {
237+
jest.mock('../../../../../commands/gen2-migration/refactor/generators/migration-readme-generator', () => {
238238
return function () {
239239
return {
240240
initialize: mockReadMeInitialize,
@@ -367,7 +367,7 @@ const stubCategoryTemplateGenerator = {
367367
],
368368
}),
369369
};
370-
jest.mock('./category-template-generator', () => {
370+
jest.mock('../../../../../commands/gen2-migration/refactor/generators/category-template-generator', () => {
371371
return jest.fn().mockImplementation(() => {
372372
return stubCategoryTemplateGenerator;
373373
});

0 commit comments

Comments
 (0)