Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
lib-ical
Commits
c89a71d0
Commit
c89a71d0
authored
Dec 08, 2015
by
Andi Sidwell
Browse files
Remove error on ICalCalendar.addEvent() for missing end time
Followup to #32.
parent
ad2d50d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/calendar.js
View file @
c89a71d0
...
...
@@ -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!
'
;
...
...
test/test_0.1.x.js
View file @
c89a71d0
...
...
@@ -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
();
...
...
test/test_0.2.x.js
View file @
c89a71d0
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment