CCAT practice simulator with text and visual question corpora.
- Install dependencies:
npm install- Start the Vite dev server:
npm run dev- Open the local URL printed in the terminal (typically
http://localhost:5173).
Build static output:
npm run buildPreview the production build locally:
npm run previewindex.html: Vite shell mounting the React rootsrc/App.jsx: React-rendered app shellsrc/main.jsx: React entry pointsrc/index.css: application stylesheetsrc/utils/: app logic split by responsibility (state/parsing/rendering/runtime)public/data/questions-text.txt: text corpuspublic/data/questions-visual.json: visual/text mixed corpus
- Test runner: Vitest with jsdom environment
- React components: React Testing Library (RTL) + user-event for user-focused tests
- Logic: Pure Vitest tests for utilities and state management
React components (use RTL patterns):
import { render, screen, fireEvent } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
it('handles user interaction', async () => {
const user = userEvent.setup()
render(<MyComponent />)
await user.click(screen.getByRole('button', { name: 'Click me' }))
expect(screen.getByText('clicked')).toBeInTheDocument()
})See src/tests/app.react.integration.test.jsx for a reference implementation.
Logic utilities (pure Vitest):
import { expect, it } from 'vitest'
import { parseQuestions } from '../utils/parsing.js'
it('parses text corpus', () => {
const result = parseQuestions('1. Question?\nA) A\nB) B')
expect(result).toHaveLength(1)
})npm run test # Run all tests once
npm run test:ui # Interactive test UI
npm run test:coverage # Coverage report- Legacy
public/js/has been retired. - Runtime initialization now starts from
src/App.jsxand callsinitAppfromsrc/utils/app.js. - Tests now run from
src/__tests__/.