@financial-times/ccc-test-helpers
v2.1.5
Published
Shared test helpers for FT Custom Code Components
Maintainers
Keywords
Readme
ccc-test-helpers
Shared testing utilities for Custom Code Components (CCC) monorepo. This package centralises reusable testing helpers used across the CCC monorepo and scaffolded CCC projects. Its purpose is to standardise common testing patterns and avoid duplication across projects.
Scope This package contains shared utilities for:
- E2E testing using Playwright
- Unit testing using Vitest
- CCC-specific mocking and lifecycle helpers
- Shared fixtures and test setup utilities
E2E testing using Playwright
- Utilities to simplify Playwright-based end-to-end tests for CCC projects (mocking component loaders, wiring event listeners, test fixtures, etc.).
- Designed to be used alongside the monorepo E2E setup and Scaffolded CCC projects
Quick example
import { setUpCCCErrorEventListener } from "@financial-times/ccc-test-helpers/playwright/browser";
Unit Testing
A library of utilities to support unit testing of CCC projects using Vitest.
import {} from "@financial-times/ccc-test-helpers/unit-test";Project files
- Playwright browser helpers: ccc-test-helpers/src/playwright/browser.ts
- Unit test helpers entrypoint: ccc-test-helpers/src/unit-test/index.ts
- Configuration: ccc-test-helpers/tsconfig.json
- Package metadata / scripts: ccc-test-helpers/package.json
