chai-date-proximity

0.0.3 • Public • Published

chai-date

An extension to the chai assertion library that provides a date proximity assertion.

Installation

$ npm install chai-date

Usage

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

Assertions

closeToDate

Asserts that a date is close to another date.

var date1 = new Date(2014, 3, 1, 13, 30, 10)
var date2 = new Date(2014, 3, 1, 13, 30, 40)
date1.should.be.closeToDate(date2, 30, 'seconds')
date1.should.be.closeToDate(date2, 30) // seconds is the default
date1.should.not.be.closeToDate(date2, 20, 'seconds')

Authors James Pike

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    293
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    293
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i chai-date-proximity

Weekly Downloads

225

Version

0.0.3

License

MIT

Last publish

Collaborators

  • jpike