mirror of
https://github.com/nasa/openmct.git
synced 2025-01-20 03:36:44 +00:00
[Topic] Add test case
...which specifies desired behavior for nasa/openmctweb#231.
This commit is contained in:
parent
96a7c12d69
commit
acdd9622d2
@ -65,6 +65,21 @@ define(
|
||||
expect(mockCallback).toHaveBeenCalledWith(testMessage);
|
||||
});
|
||||
|
||||
it("is robust against errors thrown by listeners", function () {
|
||||
var mockBadCallback = jasmine.createSpy("bad-callback"),
|
||||
t = topic();
|
||||
|
||||
mockBadCallback.andCallFake(function () {
|
||||
throw new Error("I'm afraid I can't do that.");
|
||||
});
|
||||
|
||||
t.listen(mockBadCallback);
|
||||
t.listen(mockCallback);
|
||||
|
||||
t.notify(testMessage);
|
||||
expect(mockCallback).toHaveBeenCalledWith(testMessage);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user