aboutsummaryrefslogtreecommitdiffstats
path: root/test/caldav/errors_test.js
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2013-05-06 21:18:31 -0700
committerJames Lal <james@lightsofapollo.com>2013-05-06 21:18:31 -0700
commit0b4733ebb28368198b747079d51033a7eeb1f276 (patch)
tree0d48aca900256baf82f0aa599d455a978780fa19 /test/caldav/errors_test.js
parentc81e925aa6dada192db75dccd4287ab1e9e09ab2 (diff)
downloadjsCalDAV-0b4733ebb28368198b747079d51033a7eeb1f276.tar.gz
Initial error refactoring (make errors less HTTP specific)
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);
+
+});