diff options
author | Théodore Biadala <theodore@biadala.net> | 2014-10-16 11:12:47 +0200 |
---|---|---|
committer | Théodore Biadala <theodore@biadala.net> | 2014-10-16 11:16:25 +0200 |
commit | 3fa3482b3c02221ae6380980630b35729fc763f9 (patch) | |
tree | 099d42f01010509d2c4b9965fdf6855307ea9995 | |
parent | 6c3c03d6c1b974c03f1276e65fc3f2bba5e4393e (diff) | |
download | jquery-once-3fa3482b3c02221ae6380980630b35729fc763f9.zip jquery-once-3fa3482b3c02221ae6380980630b35729fc763f9.tar.gz jquery-once-3fa3482b3c02221ae6380980630b35729fc763f9.tar.bz2 |
Add test to make sure an error is triggered when ID is missing
-rw-r--r-- | test/test.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test.js b/test/test.js index e50ac76..44ab452 100644 --- a/test/test.js +++ b/test/test.js @@ -1,3 +1,13 @@ +test("ID required", function() { + expect(1); + try { + $("#test1 span").once(); + } + catch (e) { + ok(e, "Error is triggered when ID is missing."); + } +}); + test(".once('test1-2') properly executed", function() { // Create one once('test1-2') call. $('#test1 span').once('test1-2').data('test1-2', 'foo'); |