Skip to content

Commit 8fbced6

Browse files
committed
test: add test for createProject
1 parent 07e6e5d commit 8fbced6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/create-project.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ import { expect, test } from "vitest";
55
import { createProject } from "./create-project";
66
import { ProjectError } from "./errors";
77

8+
test("no cwd", async () => {
9+
await temporaryDirectoryTask(async (dir) => {
10+
const project = createProject({
11+
indexFilePath: "./no-such-file.ts",
12+
cwd: join(dir, "this-dir-does-not-exist"),
13+
});
14+
expect(project.isErr()).toBe(true);
15+
expect(project._unsafeUnwrapErr() instanceof ProjectError).toBe(true);
16+
});
17+
});
18+
819
test("no index file", async () => {
920
await temporaryDirectoryTask(async (dir) => {
1021
const project = createProject({

0 commit comments

Comments
 (0)