diff --git a/test/hyphenopoly.module_test.js b/test/hyphenopoly.module_test.js index bcb41f3b..7cdea667 100644 --- a/test/hyphenopoly.module_test.js +++ b/test/hyphenopoly.module_test.js @@ -113,6 +113,28 @@ describe("hyphenopoly.module", function () { }); it("uses language agnostic (global) exceptions", function (done) { + H9Y.config({ + "exceptions": { + "global": "Silben-trennung" + }, + "hyphen": "•", + "require": ["de"] + }).then( + function (hyphenateText) { + if (hyphenateText("Silbentrennung") === "Silben•trennung") { + done(); + } else { + done(new Error(hyphenateText("Silbentrennung"))); + } + } + ).catch( + function (e) { + done(new Error(e)); + } + ); + }); + + it("uses language both kind of exceptions", function (done) { H9Y.config({ "exceptions": { "global": "Silben-trennung", @@ -348,5 +370,21 @@ describe("hyphenopoly.module", function () { } ); }); + + it("throws for unknown event", function (done) { + H9Y.config({ + "require": ["de"], + "handleEvent": { + "error": function (e) { + if (e.msg === "unknown Event \"fantasyEvent\" discarded") { + done(); + } + }, + "fantasyEvent": function (e) { + console.log(42); + } + } + }); + }); }); });