Commit c89a71d0 authored by Andi Sidwell's avatar Andi Sidwell
Browse files

Remove error on ICalCalendar.addEvent() for missing end time

Followup to #32.
parent ad2d50d7
......@@ -285,11 +285,6 @@ var ICalCalendar = function(_data) {
throw 'event.start is a mandatory item!';
}
// validation: end
if(!event.end) {
throw 'event.end is a mandatory item!';
}
// validation: summary
if(!event.summary) {
throw 'event.summary is a mandatory item!';
......
......@@ -185,17 +185,6 @@ describe('ical-generator 0.1.x', function() {
}, /event\.start must be a Date Object/);
});
it('should throw error when no end time given', function() {
var generator = require(__dirname + '/../lib/index.js'),
cal = generator();
assert.throws(function() {
cal.addEvent({
start: new Date()
});
}, /event\.end is a mandatory item/);
});
it('should throw error when end time is not a date', function() {
var generator = require(__dirname + '/../lib/index.js'),
cal = generator();
......
......@@ -230,6 +230,15 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
assert.equal(event.summary(), 'Patch-Day');
});
it('should not require optional parameters', function() {
assert.doesNotThrow(function () {
ical().addEvent({
start: new Date(),
summary: 'Patch-Day'
});
}, Error);
});
});
describe('events()', 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