# @xieyuheng/test-case

> Minimalist Test Framework for JavaScript/TypeScript.

Latest version **0.0.15** (published 2023-10-07) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @xieyuheng/test-case
pnpm add @xieyuheng/test-case
yarn add @xieyuheng/test-case
bun add @xieyuheng/test-case
```

Provides the command `test-case`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.15 |
| Published | 2023-10-07 |
| First published | 2022-03-31 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 60.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | xieyuheng |

## Links

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

## Dependencies (6)

- [axios](https://npm.io/package/axios.md) ^1.5.1
- [readdirp](https://npm.io/package/readdirp.md) ^3.6.0
- [picocolors](https://npm.io/package/picocolors.md) ^1.0.0
- [@xieyuheng/ty](https://npm.io/package/@xieyuheng/ty.md) ^0.1.26
- [fast-deep-equal](https://npm.io/package/fast-deep-equal.md) ^3.1.3
- [@xieyuheng/command-line](https://npm.io/package/@xieyuheng/command-line.md) ^0.0.13

## Recent versions

- 0.0.15 (latest) — 2023-10-07
- 0.0.14 — 2022-05-17
- 0.0.13 — 2022-04-01
- 0.0.12 — 2022-03-31
- 0.0.11 — 2022-03-31
- 0.0.10 — 2022-03-31
- 0.0.9 — 2022-03-31
- 0.0.8 — 2022-03-31
- 0.0.6 — 2022-03-31
- 0.0.5 — 2022-03-31
- 0.0.4 — 2022-03-31
- 0.0.3 — 2022-03-31
- 0.0.2 — 2022-03-31
- 0.0.1 — 2022-03-31

## README

# Test Case

Minimalist Test Framework for JavaScript/TypeScript.

## Installation

```
npm install @xieyuheng/test-case
```

## Usage

### Command line tool

The command line program is called `test-case`.

```
test-case run lib/examples/number.case.js
```

## Example

```js
import { TestCase } from "@xieyuheng/test-case"

export default class extends TestCase {
  // NOTE Method name startsWith "test" will be viewed as a test
  test_add() {
    this.assertEquals(1 + 1, 2)
    this.assertNotEquals(1 + 1, 3)
  }

  "method name includes whitespace will be viewed as a test"() {
    this.assert(true)
  }
}
```

Please see [src/examples](src/examples) for more examples, including:

- [src/examples/assert-equals.case.ts](src/examples/assert-equals.case.ts)
- [src/examples/assert-error.case.ts](src/examples/assert-error.case.ts)

### Subclassing

- Example subclassing: [lexer-test-case.ts](https://github.com/cicada-lang/sexp/blob/master/src/lexer/lexer-test-case.ts)
- Example test case class: [lexer.case.ts](https://github.com/cicada-lang/sexp/blob/master/src/lexer/lexer.case.ts)

## Development

```
npm install    // Install dependencies
npm run build  // Compile `src/` to `lib/`
npm run watch  // Watch the compilation
npm run test   // Run test
```

## Contributions

> Be polite, do not bring negative emotion to others.

- [TODO.md](TODO.md)
- [STYLE-GUIDE.md](STYLE-GUIDE.md)
- [CODE-OF-CONDUCT.md](CODE-OF-CONDUCT.md)
- When contributing, add yourself to [AUTHORS](AUTHORS)

## License

- [GPLv3](LICENSE)

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