Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch InternalOAuthError test case to Mocha.
- Loading branch information
1 parent
79d2ffd
commit 9d625a3
Showing
2 changed files
with
30 additions
and
39 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var InternalOAuthError = require('../../lib/errors/internaloautherror'); | ||
|
||
|
||
describe('InternalOAuthError', function() { | ||
|
||
describe('constructed with a message', function() { | ||
var err = new InternalOAuthError('oops'); | ||
|
||
it('should format correctly', function() { | ||
expect(err.toString()).to.equal('oops'); | ||
}); | ||
}); | ||
|
||
describe('constructed with a message and error', function() { | ||
var err = new InternalOAuthError('oops', new Error('something is wrong')); | ||
|
||
it('should format correctly', function() { | ||
expect(err.toString()).to.equal('oops (Error: something is wrong)'); | ||
}); | ||
}); | ||
|
||
describe('constructed with a message and object with status code and data', function() { | ||
var err = new InternalOAuthError('oops', { statusCode: 401, data: 'invalid OAuth credentials' }); | ||
|
||
it('should format correctly', function() { | ||
expect(err.toString()).to.equal('oops (status: 401 data: invalid OAuth credentials)'); | ||
}); | ||
}); | ||
|
||
}); |