Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
* A single block of unit tests
*/
describe('Date tests', function () {
/*
* The SETUP function : it sets the environment variables
*/
before(function () {
this.date = new Date(2016, 3, 15);
});
/*
* List of assertions
*/
it('date should be defined', function () {
assert(this.date);
});
it('year should be correct', function () {
assert(this.date.getFullYear() === 2016);
});
it('month should be correct', function () {
assert(this.date.getMonth() === 3);
});
it('day should be correct', function () {
assert(this.date.getDate() === 15);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment