Skip to content

test: add Vitest unit tests for app utilities, helpers, and services#672

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/add-unit-testing-for-app-folder
Draft

test: add Vitest unit tests for app utilities, helpers, and services#672
Copilot wants to merge 4 commits into
mainfrom
copilot/add-unit-testing-for-app-folder

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 2, 2026

  • Explore codebase and identify testable pure functions
  • Add Matrices filter tests to app/utils/matrix.test.ts
  • Add getFormatedDateForFilename / getFileNameForDocument tests to app/utils/utils.common.test.ts
  • Create app/utils/pkpass.test.ts — pure pkpass helper functions
  • Create app/models/PKPass.test.ts — PKPass class methods
  • Create app/utils/batch.test.ts — shared batch/chunk utilities
  • Verify all tests pass

Copilot AI added 2 commits June 2, 2026 16:27
- Add vitest.config.ts with path aliases (~/, @shared/) and NativeScript globals
- Add tsconfig.test.json extending main tsconfig to include *.test.ts files
- Add vitest.setup.ts with mocks for @nativescript/core and @akylas/nativescript-app-utils
- Extract deduplicateFilenames() to app/utils/exportUtils.ts; use it in index.common.ts
- Add app/utils/path.test.ts (dirname, basename, extname)
- Fix basename() bug: use slice() instead of substring() for negative-index ext strip
- Add app/utils/matrix.test.ts (concatTwoColorMatrices, concatColorMatrices)
- Add app/utils/utils.common.test.ts (cleanFilename, pick, omit, sortByKey, ellipsize)
- Add app/helpers/formatter.test.ts (convertTime with dayjs)
- Add app/utils/exportUtils.test.ts (deduplicateFilenames + cleanFilename regex spec)
- Fix app/services/sync/deletedDocuments.test.ts to match tuple return type
- Add 'test' and 'test:watch' scripts to package.json
- Update .github/workflows/test.yml: trigger on PRs, run yarn install + yarn test
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.

2 participants