Unverified Commit e3218ab8 authored by Mark Stenglein's avatar Mark Stenglein
Browse files

Add tests for err on invalid exclusions

parent 0fd62369
......@@ -987,6 +987,40 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
});
}, /`repeating\.byMonthDay` contains invalid value `32`/);
});
it('should throw error when repeating.exclude is not valid', function() {
var cal = ical();
assert.throws(function() {
cal.createEvent({
start: new Date(),
end: new Date(),
summary: 'test',
repeating: {
freq: 'DAILY',
interval: 2,
byDay: ['SU'],
exclude: 'FOO'
}
});
}, /`repeating\.exclude` contains invalid value `FOO`/);
});
it('should throw error when repeating.exclude is not valid (should throw on first err value', function() {
var cal = ical();
assert.throws(function() {
cal.createEvent({
start: new Date(),
end: new Date(),
summary: 'test',
repeating: {
freq: 'DAILY',
interval: 2,
byDay: ['SU'],
exclude: [new Date(), 'BAR', 'FOO']
}
});
}, /`repeating\.exclude` contains invalid value `BAR`/);
});
});
describe('summary()', function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment