Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including unexpected-date with all npm packages installed. Try it out:

require("unexpected/package.json"); // unexpected is a peer dependency. var unexpectedDate = require("unexpected-date")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

unexpected-date v2.0.0

Unexpected plugin for date/time assertions


NPM version Build Status Coverage Status Dependency Status

Support for useful date/time assertions for Unexpected.js

Table of Contents


Use this module if you are looking for

  • Assertions on native Date objects
  • Dependency free light-weight module


You will need unexpected@10.32.0 or above to use this module.


$ npm install --save-dev unexpected-date
$ yarn add --dev unexpected-date
var expect = require("unexpected").clone();


Checkout documentation site here

Assertions Available

  • to be after
  • to be before
  • to be [inclusively] between
  • to be close to
  • to be same or after
  • to be same or before
  • to equal date
  • to equal time


This module is inspired from unexpected-moment assertions.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free