mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 16:17:58 +00:00
testing 'off' without an 'on'
This commit is contained in:
parent
e85b59755e
commit
fd75074ab0
1 changed files with 10 additions and 0 deletions
|
@ -29,6 +29,16 @@ describe("Emitter", () => {
|
|||
emitter.dispose();
|
||||
});
|
||||
|
||||
it("'off' does nothing if there is no event scheduled", () => {
|
||||
const emitter = new Emitter();
|
||||
const callback = () => {
|
||||
throw new Error("should call this");
|
||||
};
|
||||
emitter.off("something", callback);
|
||||
emitter.emit("something");
|
||||
emitter.dispose();
|
||||
});
|
||||
|
||||
it("removes all events when no callback is given", () => {
|
||||
const emitter = new Emitter();
|
||||
emitter.on("something", () => {
|
||||
|
|
Loading…
Reference in a new issue