Date assertions for the Chai assertion library
JavaScript CoffeeScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
support
test
.gitignore
README.md
package.json

README.md

chai-date

An extension to the chai assertion library that provides a set of date assertions.

Installation

$ npm install chai-date

Usage

Use the assertions with chai's expect or should assertions.

Assertions

today

Asserts that the given date is today

var today = new Date()
today.should.be.today()

yesterday

Asserts that the given date is yesterday

var yesterday = new Date(today.getDate() - 1)
yesterday.should.be.yesterday()

tomorrow

Asserts that the given date is tomorrow

var tomorrow = new Date(today.getDate() + 1)
tomorrow.should.be.tomorrow()

Test

$ npm test

Authors Christopher Garvis & Moveline

License

MIT