-
Notifications
You must be signed in to change notification settings - Fork 0
how to contribute testing
CSV Anonymizer has tests at the frontend, Tauri command, Rust core, script, package, and release-check layers. Use scoped checks while developing, then run the broader gate described in Development workflow.
| Command | What it covers |
|---|---|
npm run test |
Contract check, frontend Vitest suite, frontend production build, and cargo test --workspace
|
npm run lint |
Frontend ESLint, frontend build, and Rust clippy with -D warnings
|
npm run typecheck |
Frontend build and cargo check --workspace
|
npm run fmt |
cargo fmt --all --check |
npm run deadcode:required |
Knip frontend scans and required cargo-machete unused dependency scan |
npm run docs:check |
Verifies documented npm run commands in README.md and docs/*.md exist in package.json
|
Vitest tests live beside the React and TypeScript code under frontend/src, for example frontend/src/App.test.tsx, frontend/src/hooks/useAnonymizerWorkflow.test.tsx, and frontend/src/components/ColumnTable.test.tsx.
npm run frontend:test
npm run frontend:typecheck
npm run frontend:lintThe frontend test environment is configured in frontend/vite.config.ts with jsdom and frontend/src/test/setup.ts.
Browser workflow tests live in frontend/e2e/workflow.spec.ts. The Playwright config in frontend/playwright.config.ts starts Vite at http://127.0.0.1:5173.
cd frontend && npx playwright install chromium
npm run frontend:e2e
npm run frontend:a11yThe e2e command excludes tests tagged @a11y; the accessibility command runs the @a11y subset.
Rust unit and integration-style tests live close to their modules:
crates/csv-anonymizer-core/src/detection/testscrates/csv-anonymizer-core/src/csv_io/tests.rscrates/csv-anonymizer-core/src/direct_input/tests.rscrates/csv-anonymizer-core/src/service/tests-
src-tauri/srcmodule tests -
crates/csv-anonymizer-app/srcCLI tests
Useful scoped commands:
cargo test -p csv-anonymizer-core
cargo test -p csv-anonymizer-tauri
cargo test -p csv-anonymizer-app
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warningsDetector changes should update fixture-backed tests, especially the taxonomy, validator, privacy, and multilingual matrix coverage under crates/csv-anonymizer-core/src/detection/tests.
scripts/check-contracts.mjs compares selected Rust enums and structs in crates/csv-anonymizer-core/src/types.rs against TypeScript unions and interfaces in frontend/src/types.ts.
npm run contracts:checkRun this whenever DTOs, Tauri command payloads, privacy report fields, release readiness fields, or direct-input result shapes change.
scripts/rust-smoke.mjs builds or uses the CLI harness and verifies that fixture email values are removed from the generated output.
node scripts/rust-smoke.mjsSet CSV_ANONYMIZER_BINARY only when you intentionally want to smoke-test an existing binary path.
npm run frontend:audit
npm run cargo:audit
npm run cargo:audit:required
npm run cargo:machete
npm run cargo:machete:requiredThe local cargo:audit and cargo:machete wrappers skip when tools are missing unless the required flag, CI, or the matching CSV_ANONYMIZER_REQUIRE_* environment variable makes them mandatory.
npm run release:check
npm run tauri:prebuilt:check
npm run artifacts:rust:check
npm run linux:package-manager:checkLinux package-manager validation builds Tauri Linux artifacts, validates .deb and .rpm metadata, checks the signed APT repository generator, and validates the APT installer script. It is best run on Linux or in CI.
Benchmarks are in crates/csv-anonymizer-core/benches.
cargo bench -p csv-anonymizer-core --bench csv_streaming
cargo bench -p csv-anonymizer-core --bench direct_input_paste
cargo bench -p csv-anonymizer-core --bench detector_matrix -- --sample-size 10Use them for performance-sensitive detector, streaming, or direct-input changes. They are not a substitute for correctness tests.