Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gcaptn/tincan
A BDD testing library for Deno
https://github.com/gcaptn/tincan
bdd deno testing
Last synced: 25 days ago
JSON representation
A BDD testing library for Deno
- Host: GitHub
- URL: https://github.com/gcaptn/tincan
- Owner: gcaptn
- License: mit
- Created: 2021-05-14T10:15:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-08T15:45:45.000Z (over 1 year ago)
- Last Synced: 2024-04-14T16:14:06.090Z (8 months ago)
- Topics: bdd, deno, testing
- Language: TypeScript
- Homepage: https://deno.land/x/tincan
- Size: 179 KB
- Stars: 37
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deno - tincan - A Jest-like testing library for Deno. (Modules / Testing)
README
tincan
A lightweight Jest-like testing library for Deno
## Features
- Nested suites / cases
- Reports cases with the full hierarchy
- Hooks (`beforeAll`, `afterAll`, `beforeEach`, `afterEach`)
- Focusing (`*.only()`)
- Skipping (`*.skip()`)
- Uses `Deno.test`, works with the built-in reporter
- Lightweight## Running
```sh
deno test
```## Usage
```ts
import {
beforeEach,
describe,
expect,
it,
run,
} from "https://deno.land/x/tincan/mod.ts";describe("Array", () => {
let array: number[];beforeEach(() => {
array = [];
});describe("#indexOf()", () => {
it("should return the first index of an item", () => {
array.push(0);
expect(array.indexOf(0)).toBe(0);
});it.only("should return -1 when the item isn't found", () => {
expect(array.indexOf(0)).toBe(-1);
});
});
});run();
```