Skip to content

Commit 1f09367

Browse files
committed
chore: fix lint issues
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 63404c2 commit 1f09367

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/actions/generate-docs/__tests__/homepage-projects-updater.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import path from "node:path";
22
import fs from "node:fs";
33
import mockFs from "mock-fs";
4+
import { fileURLToPath } from "node:url";
45
import { describe, expect, it, vi } from "vitest";
56

7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const workspaceRoot = path.resolve(__dirname, "../../../..");
10+
611
process.env.GITHUB_REPOSITORY_OWNER ??= "hoverkraft-tech";
712
process.env.GITHUB_REPOSITORY ??= "hoverkraft-tech/public-docs";
813

@@ -14,7 +19,7 @@ const { ConstDeclarationUpdater } = await import(
1419
);
1520

1621
const homepagePath = path.join(
17-
process.cwd(),
22+
workspaceRoot,
1823
"application/src/pages/index.tsx",
1924
);
2025
const repositories = [
@@ -121,6 +126,7 @@ describe("HomepageProjectsUpdater", () => {
121126
const updatedHomepage = fs.readFileSync(homepagePath, "utf8");
122127

123128
expect(updatedHomepage).toContain('name: "compose-action"');
129+
expect(updatedHomepage).toContain("const projects = [");
124130
expect(updatedHomepage).toContain(
125131
'tags: ["continuous-integration", "docker-compose", "github-actions"]',
126132
);

.github/actions/generate-docs/lib/homepage/homepage-projects-updater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function serializeHomepageProjects(projects) {
9494
.map((project) => serializeHomepageProject(project, 1))
9595
.join(",\n");
9696

97-
return `\n${body}\n`;
97+
return `[\n${body}\n]`;
9898
}
9999

100100
function serializeHomepageProject(project, indentLevel) {

0 commit comments

Comments
 (0)