test: add authorize 100% coverage

This commit is contained in:
divlo
2020-12-29 04:05:39 +01:00
parent 0e534dd8ee
commit d44bd9e17e
6 changed files with 195 additions and 74 deletions

16
src/UnauthorizedError.ts Normal file
View File

@@ -0,0 +1,16 @@
export class UnauthorizedError extends Error {
public inner: { message: string }
public data: { message: string, code: string, type: 'UnauthorizedError' }
constructor (code: string, error: { message: string }) {
super(error.message)
this.message = error.message
this.inner = error
this.data = {
message: this.message,
code,
type: 'UnauthorizedError'
}
Object.setPrototypeOf(this, UnauthorizedError.prototype)
}
}