1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-04-14 01:43:13 +00:00

chore: better test coverage

This commit is contained in:
2025-03-04 14:48:22 +01:00
parent 18be9e8806
commit b3b2c1414c
5 changed files with 487 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { SAS9AuthError } from '../SAS9AuthError'
describe('SAS9AuthError', () => {
it('should have the correct error message', () => {
const error = new SAS9AuthError()
expect(error.message).toBe(
'The credentials you provided cannot be authenticated. Please provide a valid set of credentials.'
)
})
it('should have the correct error name', () => {
const error = new SAS9AuthError()
expect(error.name).toBe('AuthorizeError')
})
it('should be an instance of SAS9AuthError', () => {
const error = new SAS9AuthError()
expect(error).toBeInstanceOf(SAS9AuthError)
})
it('should be an instance of Error', () => {
const error = new SAS9AuthError()
expect(error).toBeInstanceOf(Error)
})
it('should set the prototype correctly', () => {
const error = new SAS9AuthError()
expect(Object.getPrototypeOf(error)).toBe(SAS9AuthError.prototype)
})
})