Skip to content

Commit 23191c7

Browse files
committed
add tests
1 parent a4c1936 commit 23191c7

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

packages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,31 @@ createClerkClient();
6969
`,
7070
output: `
7171
<OrganizationProfile />;
72+
`,
73+
},
74+
{
75+
name: 'Does not rename class constructors',
76+
source: `
77+
export class AppError extends Error {
78+
constructor(
79+
message: string,
80+
public readonly code: string,
81+
public readonly statusCode: number = 500
82+
) {
83+
super(message);
84+
}
85+
}
86+
`,
87+
output: `
88+
export class AppError extends Error {
89+
constructor(
90+
message: string,
91+
public readonly code: string,
92+
public readonly statusCode: number = 500
93+
) {
94+
super(message);
95+
}
96+
}
7297
`,
7398
},
7499
];

packages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { fixtures } from './__fixtures__/transform-align-experimental-unstable-p
66

77
describe('transform-align-experimental-unstable-prefixes', () => {
88
it.each(fixtures)('$name', ({ source, output }) => {
9-
const result = applyTransform(transformer, {}, { source });
9+
const result = applyTransform(transformer, {}, { source }) || source.trim();
1010

1111
expect(result).toEqual(output.trim());
1212
});

0 commit comments

Comments
 (0)