Skip to content

chore: Vitest migration skills#33596

Open
cacieprins wants to merge 3 commits into
developfrom
chore/mocha-to-vitest-skills
Open

chore: Vitest migration skills#33596
cacieprins wants to merge 3 commits into
developfrom
chore/mocha-to-vitest-skills

Conversation

@cacieprins
Copy link
Copy Markdown
Collaborator

@cacieprins cacieprins commented Apr 13, 2026

  • Closes

Additional details

Adds a library of skills that direct AI in how to migrate unit tests in packages/server from mocha to vitest, including some basic js->ts skills.


Note

Low Risk
Documentation-only changes that add new .cursor/skills markdown guides and expose them to version control; no runtime code or test behavior is modified.

Overview
Adds a versioned library of .cursor/skills/*/SKILL.md guides for migrating @packages/server unit tests from Mocha to Vitest and from JS to TS (including mocking, nock, fake timers, Chai plugin replacements, and ASI/no-semicolon pitfalls).

Updates .gitignore to stop ignoring .cursor/skills, and links these new skills from packages/server/AGENTS.md so contributors can discover the migration playbook.

Reviewed by Cursor Bugbot for commit 02cb1f5. Bugbot is set up for automated code reviews on this repo. Configure here.

Steps to test

How has the user experience changed?

PR Tasks

@cacieprins cacieprins marked this pull request as ready for review April 13, 2026 18:46
@cacieprins cacieprins enabled auto-merge (squash) April 13, 2026 18:48
@cypress
Copy link
Copy Markdown

cypress Bot commented Apr 13, 2026

cypress    Run #69806

Run Properties:  status check passed Passed #69806  •  git commit 02cb1f5fd9: Merge branch 'develop' into chore/mocha-to-vitest-skills
Project cypress
Branch Review chore/mocha-to-vitest-skills
Run status status check passed Passed #69806
Run duration 18m 57s
Commit git commit 02cb1f5fd9: Merge branch 'develop' into chore/mocha-to-vitest-skills
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 11
Tests that did not run due to a developer annotating a test with .skip  Pending 1112
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 27222
View all changes introduced in this branch ↗︎
UI Coverage  61.04%
  Untested elements 28  
  Tested elements 47  
Accessibility  99.02%
  Failed rules  0 critical   3 serious   1 moderate   0 minor
  Failed elements 18  


## Reference migration

- **`packages/server/test/unit/browsers/cdp-command-queue.spec.ts`** — migrated from `cdp-command-queue_spec.ts`; replaces **`expect(commandPromise).to.eventually.equal(resolution)`** with **`await expect(commandPromise).resolves.toBe(resolution)`**.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

how is an agent able to tell what this reference migration is since there is no historical copy present?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's a good question! The file references are probably not useful, but the example is. It may be good reference for us, because that's the file it used as a reference for the migration: these skills were written as notes taken by the agent, during the migration of the referenced file.

@@ -0,0 +1,111 @@
---
name: server-lib-js-to-ts
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we have a naming convention for skills in the repo? Or does everything sit somewhat flat in the root with a folder with the named skill?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This matches Claude's skills documentation. Folder matches skill name, kebab-case, Skill file only.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are there additional ways to organize skills, or must the folder structure be flat?

Copy link
Copy Markdown
Collaborator

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

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

The skills look good on my end and I look forward to trying them out!

The only concern I have right now is this is introducing the skills to a vitest migration in the server package, which I don't think we are ready for quite yet as the TS migration isn't complete. Trying to introduce vitest in a hybrid package has some loader difficulties and makes migration of two goals (TS and vitest) much more difficult once we introduce that path.

I'd like to start with the JS -> TS skills and we can iterate in parallel on this effort. Once we get to a place where this is mostly done and introducing vitest is much easier, then I think we introduce the rest of the skills and iterate in parallel on migrating tests. But right now, I think opening that can of worms while we are mid TS conversion isn't the best choice.

Would you be willing to make a PR for just the JS -> TS skills and we start with that?

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