@harnessed-ts/core
The driver-free core: Query, Selector, ComponentHarness, the decorators, the
driver registry, configure(), the matcher implementations, and the Vite and
Babel plugins and Node and Bun loaders that lower standard decorators.
Depends on no driver. Install a driver alongside it —
@harnessed-ts/dom or
@harnessed-ts/playwright.
// tsconfig.json — the three options decorators need
{ "extends": "@harnessed-ts/core/tsconfig.json" }
// vite.config.ts / vitest.config.ts — the transform they need
import { harnessedDecorators } from '@harnessed-ts/core/vite'
export default defineConfig({ plugins: [harnessedDecorators(), react()] })
// babel.config.cjs — an app whose own decorators are legacy (Ember)
plugins: [require.resolve('@harnessed-ts/core/babel') /* , …the app's plugins */]
# node:test — strips types, lowers decorators and compiles JSX with esbuild
node --test --import @harnessed-ts/core/register
# bunfig.toml — bun test, whatever experimentalDecorators the tsconfig sets
[test]
preload = ["@harnessed-ts/core/bun"]
Full guide, the cross-driver guarantees, and the API: the harnessed README.
MIT © Joe Gaudet, Jay Seo