# uno

> The simplest unit testing framework possible.

Latest version **0.0.2** (published 2012-05-18) · 0 weekly downloads

## Install

```sh
npm install uno
pnpm add uno
yarn add uno
bun add uno
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2012-05-18 |
| First published | 2012-05-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Evan Moran |
| Maintainers | evanmoran |
| Keywords | testing, test, unit, server, client, browser |

## Links

- npm: https://www.npmjs.com/package/uno
- Repository: https://github.com/evanmoran/uno
- Homepage: http://github.com/evanmoran/uno/
- npm.io page: https://npm.io/package/uno

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2012-05-18
- 0.0.1 — 2012-05-18

## README

_ _ ___ ___
    | | |   | . |
    |___|_|_|___|

## Uno: The simplest unit testing framework possible! ##

* One file `uno.js`
* One function `uno`
* No dependencies
* Results are printed to console.log

## How to test _functions_ ##

#### Example: Math.round function: ####
    
    uno(Math.round, [1.5], 2)
    
Output:

       logs:  "Uno test passed: round(1.5) == 2"
    returns:  true

Usage: 

    uno(name, fn, args, expected)

* `name` (optional) The name of the test. Excepts {inputs}, see below.
* `fn` The function to test
* `args` A list of arguments passed to `fn`
* `expected` What `fn(args)` should return

## How to test _methods_ ##

#### Example: Date object: ####

    var date = new Date("October 31, 2012");
    uno(date, date.getFullYear, [], 2012)

Output:

       logs:  "Uno test passed: object.getFullYear() == 2012"
    returns:  true

Usage:

    uno(name, object, method, args, expected)

* `name` (optional) The name of the test. Excepts {inputs}, see below.
* `object` The object to test
* `method` The method to test (in the context of `object`)
* `args` A list of arguments passed to `method`
* `expected` What `object.method(args)` should return



## {inputs} ##

All `name` options support {input} strings. Here is a full list:

    {method}             // alias: {function} {fn} {f}
    {args}               // alias: {arguments} {input} {in}
    {result}             // alias: {output} {out}
    {expected}

#### Example: Math.round function with custom name

    uno('Math.{fn}({args}), result: {result}, expected: {expected}', Math.round, [1.5], 2)

Output:

       logs:  "Uno test passed: Math.round(1.5), result: 2, expected: 2]"
    returns:  true

#### Example: Date object with a custom name: ####

    var date = new Date("October 31, 2012");
    uno('date.{method}({args}) == {expected}', date, date.getFullYear, [], 2012)

Output:

       logs:  "Uno test passed: date.getFullYear() == 2012"
    returns:  true





#### Full {input} list ####


## How to test _values_ ##
_(Almost done coding this)_

## How to profile ##
_(Still coding this one)_

## But wait... there is more! ##

* Uno hooks into other unit testing frameworks and does the right thing to make them work too.
* Uno auto names tests using the function name and arguments

## Supported unit testing frameworks ##

* qunit (close to finished)
* fireunit (close to finished)
* junit (just starting support)

## Install by source ##

* [uno.js](https://raw.github.com/evanmoran/uno/master/uno.js)

## Install to node ##

    npm install uno
    
## Usage in node ##

    uno = require('uno')
    
    uno(Math.round, [1.5], 2)      // logs: "Uno test passed: round(1.5) == 2"

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