diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2019-12-11 14:31:56 -0500 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@protonmail.com> | 2019-12-11 14:31:56 -0500 |
| commit | 0d810aa92e9b54493a2e075c3bb497b3857a2119 (patch) | |
| tree | 2077c2f3f30d1253a1f4565526aaa60f28576db7 /src | |
| parent | efd9095988fe9b76096342e84c6f3f1bc5d67120 (diff) | |
| download | ao-coverage-0d810aa92e9b54493a2e075c3bb497b3857a2119.tar.gz ao-coverage-0d810aa92e9b54493a2e075c3bb497b3857a2119.tar.bz2 ao-coverage-0d810aa92e9b54493a2e075c3bb497b3857a2119.zip | |
Add ts-jest to improve TS coverage reports
Diffstat (limited to 'src')
| -rw-r--r-- | src/errors.test.ts | 27 | ||||
| -rw-r--r-- | src/errors.ts | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/errors.test.ts b/src/errors.test.ts new file mode 100644 index 0000000..235c0d2 --- /dev/null +++ b/src/errors.test.ts @@ -0,0 +1,27 @@ +import { InvalidReportDocumentError, BranchNotFoundError } from "./errors"; + +describe("InvalidReportDocumentError", () => { + it("should have the correct name and default message", () => { + // Arrange + + // Act + const err = new InvalidReportDocumentError(); + + // Assert + expect(err.name).toEqual("InvalidReportDocumentError"); + expect(err.message).toEqual("Invalid report document"); + }); +}); + +describe("BranchNotFoundError", () => { + it("should have the correct name and default message", () => { + // Arrange + + // Act + const err = new BranchNotFoundError(); + + // Assert + expect(err.name).toEqual("BranchNotFoundError"); + expect(err.message).toEqual("Branch not found"); + }); +}); diff --git a/src/errors.ts b/src/errors.ts index 3af634d..6e8c32f 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,6 +1,7 @@ export class BranchNotFoundError extends Error { constructor() { super(); + this.name = "BranchNotFoundError"; this.message = "Branch not found"; } } @@ -8,6 +9,7 @@ export class BranchNotFoundError extends Error { export class InvalidReportDocumentError extends Error { constructor() { super(); + this.name = "InvalidReportDocumentError"; this.message = "Invalid report document"; } } |
