# BucklerJS

A simple javascript test framework

## Install

```
yarn add buckler-js -D
```

## Write a test

```javascript
export function AddTwoNumbers() {
  return add(3, 5) === 8;
}
```

## Run the test

```
$ buckler example.js
```

Buckler will generate TAP output as a result

![tap](https://raw.githubusercontent.com/subhero24/buckler-js/master/doc/1.png)

You can always pipe the output to a TAP formatter (e.g. tap-difflet) if you want pretty test results

```
$ buckler example.js | tap-difflet
```

![tap](https://raw.githubusercontent.com/subhero24/buckler-js/master/doc/2.png)

## More info

By default buckler will look for all files within the current directory with a .test.js extension.

You can also use a glob to specify the files you want.

```
$ buckler **/test/*.js
```

Buckler will run all exported functions from every file, and generate a report.

If the function returns true, the test passes. If the function returns false, the test fails.
