Skip to content

Add unit tests for the date/spreadsheet helpers and wire up CI - #17

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785281505-lib-unit-tests
Closed

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785281505-lib-unit-tests

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The pure helpers in lib/ (event date math, CSV parsing, email/code extraction) had no coverage, and nothing ran on PRs. This adds Vitest plus a GitHub Actions job so lint, typecheck, and tests all run on every pull request.

Covered behavior worth calling out, since it's easy to regress:

  • daysUntilEvent compares calendar days, not elapsed time — both sides are normalized to local midnight, so a 3pm now still yields 0 for an event today and 1 for tomorrow. Tests pass an explicit now (new Date(2026, 6, 17, 15, 30)) so they're deterministic, and one case spans a DST boundary where a naive (event - now) / 86400000 would be off.
  • eventCountdownLabel maps 0 → "Today", 1 → "Tomorrow", n → "In n days", and null once past.
  • extractCodes prefers a /^[\w\s]*codes?$/i header column but keeps every row of a headerless single-column file.

Runner is Node 22 in CI (Vitest 4 needs ≥20.19); npm test = vitest run.

Link to Devin session: https://app.devin.ai/sessions/a2b97d4e12ba4d19bedd24a6a58f237f
Requested by: @dabit3


Open in Devin Review

Co-Authored-By: Nader Dabit <dabit3@gmail.com>
@dabit3 dabit3 self-assigned this Jul 28, 2026
@dabit3
dabit3 self-requested a review July 28, 2026 23:32
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vending-machine Ready Ready Preview, Comment Jul 28, 2026 11:33pm

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

This branch was successfully deployed

1 active deployment
Preview — 738e0e3c Deployed Jul 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant