test: add comprehensive unit test suite for URL parsing, i18n, and version comparison#44
Merged
flexiondotorg merged 3 commits intomainfrom Mar 24, 2026
Merged
test: add comprehensive unit test suite for URL parsing, i18n, and version comparison#44flexiondotorg merged 3 commits intomainfrom
flexiondotorg merged 3 commits intomainfrom
Conversation
Add comprehensive test coverage for URL parsing functions: - Set up Vitest configuration with globals and Node environment - Create 18 unit tests for parseStartUrl and parseLastPageUrl functions - Export URL parsing functions from src/main.ts for testability - Add test setup file with mock configurations for all dependencies Update build tooling: - Rename justfile `test` recipe to `validate` for build config checks - Add new `test` recipe that runs npm test - Rename GitHub Actions `test` job to `test-config` - Add new `test-code` job for running unit tests in CI Add test dependencies: - vitest, @vitest/ui, @vitest/coverage-v8 - Update npm scripts with test and coverage commands Signed-off-by: Martin Wimpress <code@wimpress.io>
- Export isNewer function from update module for testing - Add i18n.test.ts: 5 tests for locale fallback chain in getLocalizedString - Add update.test.ts: 7 tests for version comparison in isNewer - Add i18n-consistency.test.ts: 78 tests verifying translation record structure across 26 translation keys (language parity and English fallback) - Total: 90 new passing tests (108 cumulative) Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
1 issue found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="test/i18n-consistency.test.ts">
<violation number="1" location="test/i18n-consistency.test.ts:23">
P2: Do not skip missing translation records; fail the test when a listed i18n export is absent.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Add explicit test assertion to catch missing exports in TRANSLATION_RECORDS array. Previously a typo or forgotten export would be silently skipped; now the test fails and the missing export is reported as a test failure. Signed-off-by: Martin Wimpress <code@wimpress.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add comprehensive test coverage to the Electron app following a refactoring that extracted a monolithic
app.whenReady()into testable modules.Changes
Testing
npm testRelated Issues
None