chai-isodatetime
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

chai-isodatetime

NPM version

Plugin for Chai to use .toISODate() for date comparisons

Usage

import * as chai from 'chai';
import { isoDateTime } from 'chai-isodatetime';
chai.use(isoDateTime);

Assertions

  • equalDate - Checks if both dates equal each other using .toISODate() for comparison
const date1 = new Date(2013, 4, 30, 16, 5);
const date2 = new Date(2013, 4, 30, 17);
 
date1.should.equalDate(date2);
expect(date1).to.equalDate(date2)
assert.equalDate(date1, date2)

Acknowledgement

Thanks to chai-datetime for getting me most of the way there!

License

MIT

/chai-isodatetime/

    Package Sidebar

    Install

    npm i chai-isodatetime

    Weekly Downloads

    898

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    5.7 kB

    Total Files

    7

    Last publish

    Collaborators

    • jgeurts