ought

This module combines your underlying Node.js runtime's [assert](https://nodejs.org/api/assert.html) module's assertions with the pleasant diffing output from the [ava](https://github.com/avajs/ava) test runner (which is actually powered by [concordance](h

Usage no npm install needed!

<script type="module">
  import ought from 'https://cdn.skypack.dev/ought';
</script>

README

ought

This module combines your underlying Node.js runtime's assert module's assertions with the pleasant diffing output from the ava test runner (which is actually powered by concordance).

To avoid adding unnecessary overhead to your tests, ought goes out of its way to not require any of its diffing and printing dependencies unless one of your assertions has actually failed.

Usage

Install it:

npm install -D ought

Use it:

const ought = require('ought')

module.exports = function myTest () {
  const result = 34 + 43

  ought.equal(result, 77)
}

The other method is ought.notEqual.

API

Assertions

We would've kept the original assertion names, but we hate typing.

Configuration

You can configure ought with ought.config. Defaults follow:

ought.config({
  color: true
})

Output

What does the output look like? The theme's colors need some tweaking, but for now the output of test.js's failing test looks like this:

screen shot 2019-02-18 at 6 51 21 pm

Code of Conduct

This project follows Test Double's code of conduct for all community interactions, including (but not limited to) one-on-one communications, public posts/comments, code reviews, pull requests, and GitHub issues. If violations occur, Test Double will take any action they deem appropriate for the infraction, up to and including blocking a user from the organization's repositories.