Skip to content

Commit

Permalink
test: update error tests
Browse files Browse the repository at this point in the history
  • Loading branch information
velut committed Jan 26, 2024
1 parent 5d878ed commit 5514ed7
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion src/errors.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { expect, test } from "vitest";
import { FsError, OsError } from "./errors";
import {
FsError,
InstallPackageError,
OsError,
PackageDeclarationsError,
PackageJsonError,
PackageNameError,
PackageTypesError,
ProjectError,
} from "./errors";

test("os error", () => {
expect(() => {
Expand All @@ -12,3 +21,39 @@ test("fs error", () => {
throw new FsError("test");
}).toThrow();
});

test("install package error", () => {
expect(() => {
throw new InstallPackageError("test");
}).toThrow();
});

test("package name error", () => {
expect(() => {
throw new PackageNameError("test");
}).toThrow();
});

test("package json error", () => {
expect(() => {
throw new PackageJsonError("test");
}).toThrow();
});

test("package types error", () => {
expect(() => {
throw new PackageTypesError("test");
}).toThrow();
});

test("package declarations error", () => {
expect(() => {
throw new PackageDeclarationsError("test");
}).toThrow();
});

test("project error", () => {
expect(() => {
throw new ProjectError("test");
}).toThrow();
});

0 comments on commit 5514ed7

Please sign in to comment.