Skip to content

Commit

Permalink
Improve assert message
Browse files Browse the repository at this point in the history
  • Loading branch information
wanmingx.lin committed Oct 15, 2014
1 parent f8e1d25 commit 44ed87e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions eventsource/eventsource-request-cancellation.htm
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
test.step(function () {
var isActive = ((new Date()).getTime() - lastEventTime) < 2500;
if (es.readyState === EventSource.CLOSED) {
var message = "In case EventSource was stopped, it should not be active, and the last event should be an error event.";
assert_true(!isActive, message);
assert_true(lastEventType === "error", message);
assert_true(readyStateAtLastEvent === EventSource.CLOSED, message);
assert_true(!isActive, "In case EventSource was stopped, it should not be active");
assert_equals(lastEventType, "error", "In case EventSource was stopped, the last event should be an error event");
assert_equals(readyStateAtLastEvent, EventSource.CLOSED, "In case EventSource was stopped, readyState at last event should be closed");
} else {
assert_true(isActive, "EventSource is active, but readyState is EventSource.CLOSED.");
assert_true(isActive, "EventSource is active, but readyState is not EventSource.CLOSED.");
}
});
es.close();
Expand Down

0 comments on commit 44ed87e

Please sign in to comment.