Skip to content

Add Vitest setup to js package with CI integration#860

Open
wibjorn wants to merge 9 commits into
mainfrom
wbb/vitetest-addition
Open

Add Vitest setup to js package with CI integration#860
wibjorn wants to merge 9 commits into
mainfrom
wbb/vitetest-addition

Conversation

@wibjorn
Copy link
Copy Markdown
Contributor

@wibjorn wibjorn commented May 12, 2026

  • Install vitest and jsdom as dev dependencies in @microsoft/atlas-js
  • Add vitest.config.ts with jsdom environment for DOM-dependent tests
  • Update js package test script to run vitest
  • Add root-level test script to run js workspace tests
  • Add test step to main CI workflow
  • Include sample utility tests to verify setup

Output: https://github.com/microsoft/atlas-design/actions/runs/25767534079/job/75683333312

Link: preview

npm run test, npm run test:cov

- Install vitest and jsdom as dev dependencies in @microsoft/atlas-js
- Add vitest.config.ts with jsdom environment for DOM-dependent tests
- Update js package test script to run vitest
- Add root-level test script to run js workspace tests
- Add test step to main CI workflow
- Include sample utility tests to verify setup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wibjorn wibjorn requested a review from a team as a code owner May 12, 2026 21:15
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

⚠️ No Changeset found

Latest commit: 4cc415d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

wibjorn and others added 6 commits May 12, 2026 15:37
- Install @vitest/coverage-v8 for coverage reporting
- Configure vitest with v8 coverage provider (text, json-summary, html reporters)
- Add test:coverage scripts to js and root package.json
- Update CI workflow to run coverage and report summary to GitHub Actions
- Update js.instructions.md with unit testing and coverage documentation
- Update copilot-instructions.md with test/coverage commands
- Add coverage/ to .gitignore

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Move util.test.ts from src/utilities/ to test/utilities/
- Update vitest config to look in test/**/*.test.ts
- Update import paths to reference ../../src/
- Update AI instructions to reflect test/ folder convention

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add github-actions reporter conditionally when running in CI
- Remove custom PowerShell coverage summary step in favor of native annotations
- Test failures now appear as inline annotations on PR diffs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@sahiljohari sahiljohari left a comment

Choose a reason for hiding this comment

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

Could be a follow up - we could add some thresholds on minimum test coverage.

Comment thread .github/instructions/js.instructions.md Outdated
Comment thread .github/instructions/js.instructions.md Outdated
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.

3 participants