Skip to content

Ci example#6

Open
kevinccbsg wants to merge 6 commits intoinit-tutorialfrom
ci-example
Open

Ci example#6
kevinccbsg wants to merge 6 commits intoinit-tutorialfrom
ci-example

Conversation

@kevinccbsg
Copy link
Member

This pull request introduces browser-based testing with TWD (Test While Developing) and integrates it into the project’s development workflow. It adds sample tests, test mocks, documentation, and a CI pipeline for running TWD tests automatically. The changes also include minor accessibility improvements and the necessary package updates.

TWD Integration and Usage

  • Added twd-js as a dependency in package.json to enable browser-based testing.
  • Updated src/main.tsx to initialize TWD in development mode, loading all test files and configuring request mocking via service worker.
  • Created .cursor/rules/twd.md with comprehensive documentation for writing and running TWD tests, including patterns, best practices, and usage guidelines.

Testing and Mock Data

  • Added sample TWD tests: src/twd-tests/helloWorld.twd.test.ts for a basic component and src/twd-tests/todoPage.twd.test.ts for the Todo page, including request mocking and user interactions. [1] [2]
  • Introduced mock data for the Todo list in src/twd-tests/mocks/todoList.json to support test scenarios.

Continuous Integration

  • Added .github/workflows/ci.yml to run TWD tests in CI, including setup for Node.js, Vite dev server, Puppeteer browser caching, and Chrome installation.

Accessibility Improvement

  • Updated the delete button in src/pages/TodoList/TodoItem.tsx to include an aria-label, improving accessibility for screen readers.

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