示例#1
0
 it('converts a string type to a numeric code, if valid code', function () {
   assert.equal(AuthErrors.toErrno('UNKNOWN_ACCOUNT'), 102);
 });
示例#2
0
 it('returns the string if an invalid code', function () {
   assert.equal(AuthErrors.toErrno('this is an invalid code'), 'this is an invalid code');
 });
示例#3
0
 it('returns the errno from an error object', function () {
   var err = AuthErrors.toError('INVALID_TOKEN', 'bad token, man');
   assert.equal(AuthErrors.toErrno(err), 110);
 });