aboutsummaryrefslogtreecommitdiffstats
path: root/test/caldav/errors_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/caldav/errors_test.js')
-rw-r--r--test/caldav/errors_test.js27
1 files changed, 27 insertions, 0 deletions
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);
+
+});