From 0b4733ebb28368198b747079d51033a7eeb1f276 Mon Sep 17 00:00:00 2001 From: James Lal Date: Mon, 6 May 2013 21:18:31 -0700 Subject: Initial error refactoring (make errors less HTTP specific) --- test/caldav/errors_test.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/caldav/errors_test.js (limited to 'test/caldav/errors_test.js') diff --git a/test/caldav/errors_test.js b/test/caldav/errors_test.js new file mode 100644 index 0000000..e02ea84 --- /dev/null +++ b/test/caldav/errors_test.js @@ -0,0 +1,27 @@ +testSupport.lib('errors'); + +suite('errors/authentication', function() { + var Errors; + + suiteSetup(function() { + Errors = Caldav.require('errors'); + }); + + function verifyErrorExists(symbol) { + test(symbol, function() { + var error = new Errors[symbol]('oops'); + assert.equal(error.message, 'oops'); + assert.ok(error.name, 'has name'); + assert.ok(error.stack, 'has stack'); + }); + } + + // why grouped? gjslint hates us otherwise + ([ + 'Authentication', + 'InvalidEntrypoint', + 'ServerFailure', + 'Unknown' + ]).forEach(verifyErrorExists); + +}); -- cgit