Skip to content

Commit 22228bb

Browse files
authored
test(resume-parser): add timezone boundary coverage (JhaSourav07#3153)
## Description Fixes JhaSourav07#2880 Added isolated unit tests for `lib/resume-parser.ts` focusing on parsing stability across timezone-related text inputs and calendar boundary edge cases. ### Changes - Added `lib/resume-parser.timezone-boundaries.test.ts` - Tested parser behavior with UTC, EST, IST, and timezone-style date references - Verified leap-year date references do not cause parsing failures - Tested daylight-saving and calendar boundary text inputs - Confirmed email extraction remains stable across varied date and timezone formats - Verified parser output remains consistent when processing date-related content - Improved coverage around date-oriented parsing edge cases and boundary conditions ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [x] 🕐 Pillar 3 — Timezone Logic Optimization - [ ] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A (test-only changes) ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally. - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [ ] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have starred the repo. - [x] I have made sure that I have only one commit to merge in this PR. - [x] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no visual changes made). - [ ] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents d688b04 + eeb4635 commit 22228bb

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// lib/resume-parser.timezone-boundaries.test.ts
2+
3+
import { describe, expect, it } from 'vitest';
4+
import { parseResume } from './resume-parser';
5+
6+
describe('Resume Parser Timezone Boundaries', () => {
7+
it('parses resume data consistently with UTC date strings', async () => {
8+
const resume = `
9+
John Doe
10+
john@example.com
11+
12+
Experience
13+
Software Engineer 2020-2024 UTC
14+
`;
15+
16+
const result = await parseResume(Buffer.from(resume), 'application/pdf');
17+
18+
expect(result).toBeDefined();
19+
expect(typeof result.name).toBe('string');
20+
});
21+
22+
it('parses resume data consistently with EST date strings', async () => {
23+
const resume = `
24+
John Doe
25+
john@example.com
26+
27+
Experience
28+
Software Engineer 2020-2024 EST
29+
`;
30+
31+
const result = await parseResume(Buffer.from(resume), 'application/pdf');
32+
33+
expect(result).toBeDefined();
34+
expect(result.experience).toBeDefined();
35+
});
36+
37+
it('parses resume data consistently with IST date strings', async () => {
38+
const resume = `
39+
John Doe
40+
john@example.com
41+
42+
Education
43+
University Degree 2019-2023 IST
44+
`;
45+
46+
const result = await parseResume(Buffer.from(resume), 'application/pdf');
47+
48+
expect(result).toBeDefined();
49+
expect(result.education).toBeDefined();
50+
});
51+
52+
it('handles leap-year date references without failures', async () => {
53+
const resume = `
54+
John Doe
55+
john@example.com
56+
57+
Experience
58+
Project Lead Feb 29 2024
59+
`;
60+
61+
const result = await parseResume(Buffer.from(resume), 'application/pdf');
62+
63+
expect(result).toBeDefined();
64+
});
65+
66+
it('handles daylight-saving and boundary date text safely', async () => {
67+
const resume = `
68+
John Doe
69+
john@example.com
70+
71+
Experience
72+
Engineer March 10 2024 DST
73+
`;
74+
75+
const result = await parseResume(Buffer.from(resume), 'application/pdf');
76+
77+
expect(result).toBeDefined();
78+
expect(result.email).toBe('john@example.com');
79+
});
80+
});

0 commit comments

Comments
 (0)