Skip to content

Replace jest+puppeteer with mocha+jsdom in examples/apps#26675

Closed
alexvy86 wants to merge 0 commit intomicrosoft:mainfrom
alexvy86:main
Closed

Replace jest+puppeteer with mocha+jsdom in examples/apps#26675
alexvy86 wants to merge 0 commit intomicrosoft:mainfrom
alexvy86:main

Conversation

@alexvy86
Copy link
Contributor

@alexvy86 alexvy86 commented Mar 9, 2026

Summary

Migrates 9 packages in examples/apps/ from Jest+Puppeteer (browser E2E tests) to Mocha+jsdom (unit/component tests), following the same pattern used by examples/data-objects/inventory-app/ and packages/framework/react/.

Packages changed:

  • blobs, collaborative-textarea, contact-collection, data-object-grid, diceroller, presence-tracker, staging, task-selection, tree-comparison

Per-package changes:

  • Deleted jest.config.cjs, jest-puppeteer.config.cjs, and tests/ directories (old Puppeteer E2E tests)
  • Added .mocharc.cjs using @fluid-internal/mocha-test-setup
  • Added src/test/tsconfig.json extending tsconfig.test.node16.json
  • Updated package.json: swapped Jest/Puppeteer devDeps for mocha, @types/mocha, global-jsdom, jsdom, @fluid-internal/mocha-test-setup; added build:test:esm/test:mocha/test:mocha:esm scripts
  • Updated tsconfig.json: removed Jest types, added rootDir: "./src", excluded src/test/**
  • Added new unit/component tests under src/test/ that test React components via @testing-library/react and data model logic directly

Test plan

  • pnpm build from repo root passes (all 1461 tasks)
  • pnpm test:mocha:esm passes in all 9 packages (29 tests total)
  • ESLint passes in all 9 packages

🤖 Generated with Claude Code

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