Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions test/builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe("DoculaBuilder", () => {
options.githubPath = "";
builder.validateOptions(options);
} catch (error) {
expect(error.message).toBe("No github options provided");
expect((error as Error).message).toBe("No github options provided");
}
});
it("should validate siteDescription options", async () => {
Expand All @@ -119,7 +119,9 @@ describe("DoculaBuilder", () => {
options.siteDescription = "";
builder.validateOptions(options);
} catch (error) {
expect(error.message).toBe("No site description options provided");
expect((error as Error).message).toBe(
"No site description options provided",
);
}
});
it("should validate site title options", async () => {
Expand All @@ -129,7 +131,7 @@ describe("DoculaBuilder", () => {
options.siteTitle = "";
builder.validateOptions(options);
} catch (error) {
expect(error.message).toBe("No site title options provided");
expect((error as Error).message).toBe("No site title options provided");
}
});
it("should validate site url options", async () => {
Expand All @@ -139,7 +141,7 @@ describe("DoculaBuilder", () => {
options.siteUrl = "";
builder.validateOptions(options);
} catch (error) {
expect(error.message).toBe("No site url options provided");
expect((error as Error).message).toBe("No site url options provided");
}
});
});
Expand Down Expand Up @@ -185,7 +187,7 @@ describe("DoculaBuilder", () => {
try {
await builder.getTemplates(options, false);
} catch (error) {
expect(error.message).toContain("No template path found");
expect((error as Error).message).toContain("No template path found");
}
});
});
Expand Down Expand Up @@ -299,7 +301,7 @@ describe("DoculaBuilder", () => {
try {
await builder.buildIndexPage(data);
} catch (error) {
expect(error.message).toBe("No templates found");
expect((error as Error).message).toBe("No templates found");
} finally {
if (fs.existsSync(data.outputPath)) {
await fs.promises.rm(data.outputPath, { recursive: true });
Expand Down Expand Up @@ -362,7 +364,7 @@ describe("DoculaBuilder", () => {
try {
await builder.buildReleasePage(data);
} catch (error) {
expect(error.message).toBe("No github data found");
expect((error as Error).message).toBe("No github data found");
} finally {
if (fs.existsSync(data.outputPath)) {
await fs.promises.rm(data.outputPath, { recursive: true });
Expand Down Expand Up @@ -435,7 +437,7 @@ describe("DoculaBuilder", () => {
try {
await builder.buildDocsPages(data);
} catch (error) {
expect(error.message).toBe("No templates found");
expect((error as Error).message).toBe("No templates found");
}
});
it("should get top level documents from mega fixtures", () => {
Expand Down
Loading