SkillAgentSearch skills...

Ought

A dumb assertion library with smart diffs for JavaScript

Install / Use

/learn @testdouble/Ought
About this skill

Quality Score

0/100

Supported Platforms

Universal

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:

<img width="604" alt="screen shot 2019-02-18 at 6 51 21 pm" src="https://user-images.githubusercontent.com/79303/52981528-3c452000-33ae-11e9-92eb-893e3465a9c6.png">

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.

View on GitHub
GitHub Stars34
CategoryDevelopment
Updated4y ago
Forks0

Languages

JavaScript

Security Score

60/100

Audited on May 11, 2021

No findings