Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
Fix tests for newer versions of ava and remove bower badge from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kodie committed Aug 3, 2017
1 parent 0c4e257 commit 447e7ff
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# moment-holiday
[![npm](https://img.shields.io/npm/v/moment-holiday.svg?style=flat-square)](https://www.npmjs.com/package/moment-holiday) ![Bower](https://img.shields.io/bower/v/moment-holiday.svg?style=flat-square) [![Travis](https://img.shields.io/travis/kodie/moment-holiday.svg?style=flat-square)](https://travis-ci.org/kodie/moment-holiday) [![npm](https://img.shields.io/npm/dt/moment-holiday.svg?style=flat-square)](https://www.npmjs.com/package/moment-holiday) [![Github file size](https://img.shields.io/github/size/kodie/moment-holiday/build/moment-holiday.min.js.svg?style=flat-square)](build/moment-holiday.min.js) [![license](https://img.shields.io/github/license/kodie/moment-holiday.svg?style=flat-square)](LICENSE.md)
[![npm](https://img.shields.io/npm/v/moment-holiday.svg?style=flat-square)](https://www.npmjs.com/package/moment-holiday) [![Travis](https://img.shields.io/travis/kodie/moment-holiday.svg?style=flat-square)](https://travis-ci.org/kodie/moment-holiday) [![npm](https://img.shields.io/npm/dt/moment-holiday.svg?style=flat-square)](https://www.npmjs.com/package/moment-holiday) [![Github file size](https://img.shields.io/github/size/kodie/moment-holiday/build/moment-holiday.min.js.svg?style=flat-square)](build/moment-holiday.min.js) [![license](https://img.shields.io/github/license/kodie/moment-holiday.svg?style=flat-square)](LICENSE.md)

A [Moment.js](https://github.com/moment/moment) plugin for handling holidays.

Expand Down
28 changes: 28 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ test('holiday_1', function(t){
if (!w.length && !moment.isMoment(w)) { t.fail(e(em, l)); }
if (w.length && !moment.isMoment(w[0])) { t.fail(e(em, l)); }
});

t.pass();
});

test('holiday_2', function(t){
Expand All @@ -99,6 +101,8 @@ test('holiday_2', function(t){
if (w[m].length && !moment.isMoment(w[m][0])) { t.fail(e(em, l)); }
});
});

t.pass();
});

test('holiday_3', function(t){
Expand All @@ -108,6 +112,8 @@ test('holiday_3', function(t){
var w = moment('2009-05-10').holiday('__INVALID__');
if (w) { t.fail(e(em, l)); }
});

t.pass();
});

test('holiday_4', function(t){
Expand All @@ -118,6 +124,8 @@ test('holiday_4', function(t){
t.is(typeof w, 'object', e(em, l));
t.is(Object.keys(w).length, Object.keys(moment.holidays[l]).length, e(em, l));
});

t.pass();
});

test('holiday_5', function(t){
Expand All @@ -133,6 +141,8 @@ test('holiday_5', function(t){
if (w[m].length && !moment.isMoment(w[m][0]) && w[m][0].day() !== 0 && w[m][0].day() !== 6) { t.fail(e(em, l)); }
});
});

t.pass();
});

test('isHoliday_1', function(t){
Expand All @@ -145,6 +155,8 @@ test('isHoliday_1', function(t){
var w = m.isHoliday();
if (!~w.indexOf(h)) { t.fail(e(em, l)); }
});

t.pass();
});

test('isHoliday_2', function(t){
Expand All @@ -157,6 +169,8 @@ test('isHoliday_2', function(t){
var w = m.isHoliday(h);
t.true(w, e(em, l));
});

t.pass();
});

test('isHoliday_3', function(t){
Expand All @@ -166,6 +180,8 @@ test('isHoliday_3', function(t){
var w = moment('2018-03-17').isHoliday('__INVALID__');
t.false(w, e(em, l));
});

t.pass();
});

test('isHoliday_4', function(t){
Expand All @@ -175,6 +191,8 @@ test('isHoliday_4', function(t){
var w = moment('2011-01-01').isHoliday(null, true);
t.false(w, e(em, l));
});

t.pass();
});

test('previousHoliday_1', function(t){
Expand All @@ -184,6 +202,8 @@ test('previousHoliday_1', function(t){
var w = moment('2002-06-15').previousHoliday();
t.true(moment.isMoment(w), e(em, l));
});

t.pass();
});

test('previousHoliday_2', function(t){
Expand All @@ -197,6 +217,8 @@ test('previousHoliday_2', function(t){
if (m.day() === 0 || m.day() === 6) { t.fail(e(em2, l)); }
});
});

t.pass();
});

test('nextHoliday_1', function(t){
Expand All @@ -206,6 +228,8 @@ test('nextHoliday_1', function(t){
var w = moment('2005-03-11').nextHoliday();
t.true(moment.isMoment(w), e(em, l));
});

t.pass();
});

test('nextHoliday_2', function(t){
Expand All @@ -219,6 +243,8 @@ test('nextHoliday_2', function(t){
if (m.day() === 0 || m.day() === 6) { t.fail(e(em2, l)); }
});
});

t.pass();
});

test('holidaysBetween_1', function(t){
Expand All @@ -232,6 +258,8 @@ test('holidaysBetween_1', function(t){
if (m.day() === 0 || m.day() === 6) { t.fail(e(em2, l)); }
});
});

t.pass();
});

test('holidaysBetween_2', function(t){
Expand Down

0 comments on commit 447e7ff

Please sign in to comment.