Skip to content

Commit b39c01f

Browse files
committed
refactor: update answer keys in integration helpers for consistency
- Changed answer keys from uppercase to camelCase in integration-helpers.ts for better readability and consistency. - Updated corresponding test assertions in cli.test.ts to reflect the new key names.
1 parent 872fb2a commit b39c01f

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

packages/create-gen-app-test/src/__tests__/cli.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ describe("CLI integration via create-gen-app-test harness", () => {
5050
expect(fs.existsSync(pkgPath)).toBe(true);
5151

5252
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
53-
expect(pkg.name).toBe(answers.PACKAGE_IDENTIFIER);
54-
expect(pkg.license).toBe(answers.LICENSE);
53+
expect(pkg.name).toBe(answers.packageIdentifier);
54+
expect(pkg.license).toBe(answers.license);
5555

5656
const licenseContent = fs.readFileSync(
5757
path.join(workspace.outputDir, "LICENSE"),
5858
"utf8"
5959
);
6060
expect(licenseContent).toContain("MIT License");
61-
expect(licenseContent).toContain(answers.USERFULLNAME);
61+
expect(licenseContent).toContain(answers.fullName);
6262
} finally {
6363
cleanupWorkspace(workspace);
6464
}

packages/create-gen-app-test/src/test-utils/integration-helpers.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,16 @@ export function buildAnswers(
3131
): Record<string, string> {
3232
const safeSuffix = suffix.replace(/[^a-z0-9]/gi, "-").toLowerCase();
3333
return {
34-
USERFULLNAME: `Test User ${suffix}`,
35-
USEREMAIL: `tester-${safeSuffix}@example.com`,
36-
MODULENAME: `Test Module ${suffix}`,
37-
MODULEDESC: `Integration test module ${suffix}`,
38-
REPONAME: `integration-${safeSuffix}`,
39-
USERNAME: `tester-${safeSuffix}`,
40-
ACCESS: "public",
41-
LICENSE: "MIT",
42-
PACKAGE_IDENTIFIER: `integration-${safeSuffix}`,
34+
fullName: `Test User ${suffix}`,
35+
email: `tester-${safeSuffix}@example.com`,
36+
moduleName: `integration-${safeSuffix}`,
37+
moduleDesc: `Integration test module ${suffix}`,
38+
repoName: `integration-${safeSuffix}`,
39+
username: `tester-${safeSuffix}`,
40+
access: "public",
41+
license: "MIT",
42+
packageIdentifier: `integration-${safeSuffix}`,
4343
...overrides,
4444
};
4545
}
4646

47-

packages/create-gen-app/test-utils/integration-helpers.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,15 @@ export function buildAnswers(
3131
): Record<string, string> {
3232
const safeSuffix = suffix.replace(/[^a-z0-9]/gi, "-").toLowerCase();
3333
return {
34-
USERFULLNAME: `Test User ${suffix}`,
35-
USEREMAIL: `tester-${safeSuffix}@example.com`,
36-
MODULENAME: `Test Module ${suffix}`,
37-
MODULEDESC: `Integration test module ${suffix}`,
38-
REPONAME: `integration-${safeSuffix}`,
39-
USERNAME: `tester-${safeSuffix}`,
40-
ACCESS: "public",
41-
LICENSE: "MIT",
42-
PACKAGE_IDENTIFIER: `integration-${safeSuffix}`,
34+
fullName: `Test User ${suffix}`,
35+
email: `tester-${safeSuffix}@example.com`,
36+
moduleName: `integration-${safeSuffix}`,
37+
moduleDesc: `Integration test module ${suffix}`,
38+
repoName: `integration-${safeSuffix}`,
39+
username: `tester-${safeSuffix}`,
40+
access: "public",
41+
license: "MIT",
42+
packageIdentifier: `integration-${safeSuffix}`,
4343
...overrides,
4444
};
4545
}
46-

0 commit comments

Comments
 (0)