# taste-test

> Write tests in simple-to-read JSON. Includes support for async testing, perfomance-testing and more.

Latest version **0.1.1** (published 2022-05-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install taste-test
pnpm add taste-test
yarn add taste-test
bun add taste-test
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-05-06 |
| First published | 2022-05-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Richard J. Glanvill |
| Maintainers | thedecimalspace |
| Keywords | taste-test, test, testing, json |

## Links

- npm: https://www.npmjs.com/package/taste-test
- npm.io page: https://npm.io/package/taste-test

## Dependencies (1)

- [cmd-colour](https://npm.io/package/cmd-colour.md) ^1.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.1 (latest) — 2022-05-06
- 0.1.0 — 2022-05-05

## README

# taste-test
## taste-test testing-sweet
### Take the taste test, you'll schmaaak it!

Are puns in bad taste? Let's put it to the *taste-test*:

```
var assert = require('assert');
var taste = require('taste-test');
var test = new taste.Test();

var taste_test = {
    "In good taste tests.": {
        "Gender non-binary beef.":
            function itWorks() {
                assert.equal("Good-taste", "Good-taste", "Not in good taste.");
                return true;  //NB: If execution reaches here, assert did not fail, therefor return true;
            },
        "Pictures on your gran": {
            "Pictures on your gran.":
                function () {
                    assert.equal("Good-taste", "Good-taste", "Not in good taste.");
                    return true; 
                },
            "Pictures on your gran naked.":
                function () {
                    assert.equal("Good-taste", "Bad-taste", "Not in good taste.");
                    return true;
                }
        },

    },
    "In bad taste tests.": {
        "Gender non-binary donkey meat.":
            function itWorks() {
                assert.equal("Bad-taste", "Bad-taste", "Not in good taste.");
                return true;
            },
        "Pictures on your gran": {
            "Pictures on your gran doing rodeo.":
                function () {
                    assert.equal("Bad-taste", "Good-taste", "Not in bad taste.");
                    return true;
                },
            "Pictures on your gran doing rodeo naked.":
                function () {
                    assert.equal("Bad-taste", "Bad-taste", "Not in bad taste.");
                    return true;
                }
        },
    }
}

test.describe(taste_test);
```





## Performance
Making your users wait is in bad taste. Test the performance of your functions with *taste*, and taste of true performance.


```
const taste = require('taste-test');

const test = new taste.Performance();
test.add("Send large images down the wire only to be displayed at 150x150.",  noRushFn.bind(null, 35));
test.add("Do whatever it is Upwork does with their mobile site.",  noRushFn.bind(null, 70));
test.add("Add hundreds of links to large script and css files you dont use.",  noRushFn.bind(null, 50));
test.add("Hire a cheap developer.",  noRushFn.bind(null, 70));
test.runAsynch(10);

var slower = 0;
function noRushFn(time, done) {
  let delay = (slower++ % 2 === 0) ? 1 : 4;
  setTimeout(()=> { done(); }, time * delay);
};
```

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