This guide covers running tests and validating code quality in Small Dev Talk.
Small Dev Talk uses four types of automated testing:
- Unit Tests (Jest) — Test individual functions and modules
- E2E Tests (Cypress) — Test complete user workflows
- Linting — Verify code quality and style
- Markdown Validation — Ensure documentation quality
Jest tests are in src/scripts/index.test.js.
Run all tests:
npm run testRun with verbose output:
npm run test:verboseRun specific test file:
npm run test -- src/scripts/index.test.jsCypress tests are in cypress/e2e/.
Open Cypress Test Runner:
npm run cypressRun E2E tests headless (CI mode):
npm run e2e:headlessThis starts the dev server, waits for it, then runs tests.
Check and auto-fix code quality issues:
npm run eslint # Auto-fix
npm run eslint:check # Check onlyConfiguration: eslint.config.js
Format all code consistently:
npm run prettier # Format all files
npm run prettier:check # Check onlyConfiguration: .prettierrc
Lint all markdown files:
npm run lint:markdownConfiguration: .markdownlint.json
Run all quality checks together:
npm run validateThis runs:
- Prettier formatting
- ESLint code quality
- Jest unit tests
- Cypress E2E tests
- Markdownlint validation
GitHub Actions workflows in this repository:
- Run Prettier, ESLint, Jest, and Cypress on pushes and pull requests
- Run Markdownlint on markdown-only changes
- Run CodeQL analysis on pushes and pull requests