expectp.equal

0.0.4 • Public • Published

expectp.equal

If the only available assertion in every test suite was equal(), almost every test suite in the world would be better for it. Because equal() by nature answers the two most important questions every unit test must answer: 1) What is the actual output?, 2) What is expected output? ~ Eric Elliot

Motivation

A simple test runner to test promises.

API

module.exports = {expectP}

Examples

const {expectP} = require('./index')
const axios = require('axios')

const dbCall = axios.get('https://jsonplaceholder.typicode.com/todos/1').then(res => res.data)

const testDbCall = actual => expected =>
  expectP(actual).toEqual(expected, 'dbCall() => should return an object with task information')

testDbCall(dbCall)({ userId: 1,
  id: 1,
  title: 'delectus aut autem',
  completed: false })

Dependents (0)

Package Sidebar

Install

npm i expectp.equal

Weekly Downloads

1

Version

0.0.4

License

ISC

Unpacked Size

2.11 kB

Total Files

4

Last publish

Collaborators

  • tarasowski