# @typesafe-validator/test

> Validator test helper

Latest version **0.0.6** (published 2022-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @typesafe-validator/test
pnpm add @typesafe-validator/test
yarn add @typesafe-validator/test
bun add @typesafe-validator/test
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2022-12-27 |
| First published | 2022-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | fwh1990 |

## Links

- npm: https://www.npmjs.com/package/@typesafe-validator/test
- Repository: https://github.com/typesafe-validator/typesafe-validator
- Homepage: https://github.com/typesafe-validator/typesafe-validator#readme
- Issues: https://github.com/typesafe-validator/typesafe-validator/issues
- npm.io page: https://npm.io/package/@typesafe-validator/test

## Recent versions

- 0.0.6 (latest) — 2022-12-27
- 0.0.5 — 2022-12-27

## README

# @typesafe-validator/test

Validator test helper

# Installation

```bash
pnpm add @typesafe-validator/test -D
```

# Usage

```typescript
import { expect, test } from 'vitest';
import { testOK, testFail, testOpenapi } from '@typesafe-validator/test';

expect('case1', async () => {
  const validator = rule.myValidator();
  await testOK(validator, [source1, source2]);
});

expect('case2', async () => {
  const validator = rule.myValidator();
  await testFail(validator, [source1, source2], 'should be my rule');
});

testOpenapi({
  required: rule.myValidator(),
  optional: rule.myValidator().optional(),
  withDefault: rule.myValidator().optional().default(''),
  withDocs: rule.myValidator(),
});
```

---
_Source: https://npm.io/package/@typesafe-validator/test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
