aboutsummaryrefslogtreecommitdiffstats
path: root/test/caldav/errors_test.js
blob: e02ea84ad9d71a210faef9991cecfc5496936cc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);

});