Skip to content

Commit 7aa18fd

Browse files
committed
refactor: remove unused code and clean up test implementations across API and utility modules
1 parent 6c0074e commit 7aa18fd

4 files changed

Lines changed: 3 additions & 17 deletions

File tree

app/api/streak/route.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ import { streakParamsSchema } from '@/lib/validations';
1818
const SVG_CSP_HEADER =
1919
"default-src 'none'; style-src 'unsafe-inline' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; connect-src https://fonts.gstatic.com;";
2020

21-
// 1. Define a custom Error class for Validation
22-
class ValidationError extends Error {
23-
constructor(message: string) {
24-
super(message);
25-
this.name = 'ValidationError';
26-
}
27-
}
28-
2921
function escapeSVGText(value: string): string {
3022
return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
3123
}

app/components/CustomizeCTA.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe('CustomizeCTA', () => {
150150
});
151151

152152
it('renders responsive text sizing from mobile to desktop', () => {
153-
const { container } = render(<CustomizeCTA />);
153+
render(<CustomizeCTA />);
154154

155155
const heading = screen.getByRole('heading', { level: 2 });
156156

app/customize/utils.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import { describe, it, expect } from 'vitest';
2-
import {
3-
stripHash,
4-
isValidHex,
5-
buildQueryParams,
6-
getExportSnippet,
7-
getPlaceholderSnippet,
8-
} from './utils';
2+
import { buildQueryParams, getExportSnippet, getPlaceholderSnippet } from './utils';
93
import type { CustomizeOptions } from './types';
104

115
describe('Export Snippet utilities', () => {

lib/github.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ describe('fetchGitHubContributions', () => {
350350

351351
const promise = fetchGitHubContributions('octocat');
352352
await vi.advanceTimersByTimeAsync(500);
353-
const result = await promise;
353+
const { calendar: result } = await promise;
354354

355355
expect(fetch).toHaveBeenCalledTimes(2);
356356
expect(result.totalContributions).toBe(mockCalendar.totalContributions);

0 commit comments

Comments
 (0)