Skip to content

Commit bde37b3

Browse files
committed
fix: Refactored crate typescript file.
1 parent 1dae678 commit bde37b3

File tree

6 files changed

+513
-200
lines changed

6 files changed

+513
-200
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Red Hat
3+
Copyright (c) 2025 - 2026, Red Hat
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__tests__/cli.test.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
jest.mock('inquirer', () => ({
2-
__esModule: true,
3-
default: { prompt: jest.fn() },
4-
}));
5-
61
import path from 'path';
72
import fs from 'fs-extra';
83
import { loadCustomTemplates, mergeTemplates } from '../template-loader.js';
94
import templates from '../templates.js';
10-
import { sanitizeRepoName } from '../github.js';
115

126
const fixturesDir = path.join(process.cwd(), 'src', '__tests__', 'fixtures');
137

@@ -152,20 +146,3 @@ describe('mergeTemplates', () => {
152146
}
153147
});
154148
});
155-
156-
describe('GitHub support (create command)', () => {
157-
it('derives repo name from package name the same way the create command does', () => {
158-
// Create command uses sanitizeRepoName(pkgJson.name) for initial repo name
159-
expect(sanitizeRepoName('my-app')).toBe('my-app');
160-
expect(sanitizeRepoName('@patternfly/my-project')).toBe('my-project');
161-
expect(sanitizeRepoName('My Project Name')).toBe('my-project-name');
162-
});
163-
164-
it('builds repo URL in the format used by the create command', () => {
165-
// Create command builds https://github.com/${auth.username}/${repoName}
166-
const username = 'testuser';
167-
const repoName = sanitizeRepoName('@org/my-package');
168-
const repoUrl = `https://github.com/${username}/${repoName}`;
169-
expect(repoUrl).toBe('https://github.com/testuser/my-package');
170-
});
171-
});

0 commit comments

Comments
 (0)