Skip to content

Commit 013f756

Browse files
committed
fix: ensure consistent formatting in nexus repository tests and scripts
1 parent b25317a commit 013f756

File tree

2 files changed

+41
-29
lines changed

2 files changed

+41
-29
lines changed

registry/mavrickrishi/modules/nexus-repository/main.test.ts

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe("nexus-repository", async () => {
1111

1212
testRequiredVariables(import.meta.dir, {
1313
agent_id: "test-agent",
14-
nexus_url: "https://nexus.example.com",
15-
nexus_password: "test-password"
14+
nexus_url: "https://nexus.example.com",
15+
nexus_password: "test-password",
1616
});
1717

1818
it("configures Maven settings", async () => {
@@ -21,8 +21,8 @@ describe("nexus-repository", async () => {
2121
nexus_url: "https://nexus.example.com",
2222
nexus_password: "test-token",
2323
package_managers: JSON.stringify({
24-
maven: ["maven-public"]
25-
})
24+
maven: ["maven-public"],
25+
}),
2626
});
2727

2828
const output = await executeScriptInContainer(state, "ubuntu:20.04");
@@ -33,11 +33,11 @@ describe("nexus-repository", async () => {
3333
it("configures npm registry", async () => {
3434
const state = await runTerraformApply(import.meta.dir, {
3535
agent_id: "test-agent",
36-
nexus_url: "https://nexus.example.com",
36+
nexus_url: "https://nexus.example.com",
3737
nexus_password: "test-token",
3838
package_managers: JSON.stringify({
39-
npm: ["npm-public"]
40-
})
39+
npm: ["npm-public"],
40+
}),
4141
});
4242

4343
const output = await executeScriptInContainer(state, "ubuntu:20.04");
@@ -49,10 +49,10 @@ describe("nexus-repository", async () => {
4949
const state = await runTerraformApply(import.meta.dir, {
5050
agent_id: "test-agent",
5151
nexus_url: "https://nexus.example.com",
52-
nexus_password: "test-token",
52+
nexus_password: "test-token",
5353
package_managers: JSON.stringify({
54-
pypi: ["pypi-public"]
55-
})
54+
pypi: ["pypi-public"],
55+
}),
5656
});
5757

5858
const output = await executeScriptInContainer(state, "ubuntu:20.04");
@@ -67,31 +67,41 @@ describe("nexus-repository", async () => {
6767
nexus_password: "test-token",
6868
package_managers: JSON.stringify({
6969
maven: ["maven-public"],
70-
npm: ["npm-public"],
71-
pypi: ["pypi-public"]
72-
})
70+
npm: ["npm-public"],
71+
pypi: ["pypi-public"],
72+
}),
7373
});
7474

7575
const output = await executeScriptInContainer(state, "ubuntu:20.04");
7676
expect(output.stdout.join("\n")).toContain("☕ Configuring Maven...");
7777
expect(output.stdout.join("\n")).toContain("📦 Configuring npm...");
7878
expect(output.stdout.join("\n")).toContain("🐍 Configuring pip...");
79-
expect(output.stdout.join("\n")).toContain("✅ Nexus repository configuration completed!");
79+
expect(output.stdout.join("\n")).toContain(
80+
"✅ Nexus repository configuration completed!",
81+
);
8082
});
8183

8284
it("handles empty package managers", async () => {
8385
const state = await runTerraformApply(import.meta.dir, {
8486
agent_id: "test-agent",
8587
nexus_url: "https://nexus.example.com",
8688
nexus_password: "test-token",
87-
package_managers: JSON.stringify({})
89+
package_managers: JSON.stringify({}),
8890
});
8991

9092
const output = await executeScriptInContainer(state, "ubuntu:20.04");
91-
expect(output.stdout.join("\n")).toContain("🤔 no maven repository is set, skipping maven configuration.");
92-
expect(output.stdout.join("\n")).toContain("🤔 no npm repository is set, skipping npm configuration.");
93-
expect(output.stdout.join("\n")).toContain("🤔 no pypi repository is set, skipping pypi configuration.");
94-
expect(output.stdout.join("\n")).toContain("🤔 no docker repository is set, skipping docker configuration.");
93+
expect(output.stdout.join("\n")).toContain(
94+
"🤔 no maven repository is set, skipping maven configuration.",
95+
);
96+
expect(output.stdout.join("\n")).toContain(
97+
"🤔 no npm repository is set, skipping npm configuration.",
98+
);
99+
expect(output.stdout.join("\n")).toContain(
100+
"🤔 no pypi repository is set, skipping pypi configuration.",
101+
);
102+
expect(output.stdout.join("\n")).toContain(
103+
"🤔 no docker repository is set, skipping docker configuration.",
104+
);
95105
});
96106

97107
it("configures Go module proxy", async () => {
@@ -100,13 +110,15 @@ describe("nexus-repository", async () => {
100110
nexus_url: "https://nexus.example.com",
101111
nexus_password: "test-token",
102112
package_managers: JSON.stringify({
103-
go: ["go-public", "go-private"]
104-
})
113+
go: ["go-public", "go-private"],
114+
}),
105115
});
106116

107117
const output = await executeScriptInContainer(state, "ubuntu:20.04");
108118
expect(output.stdout.join("\n")).toContain("🐹 Configuring Go...");
109-
expect(output.stdout.join("\n")).toContain("Go proxy configured via GOPROXY environment variable");
119+
expect(output.stdout.join("\n")).toContain(
120+
"Go proxy configured via GOPROXY environment variable",
121+
);
110122
expect(output.stdout.join("\n")).toContain("🥳 Configuration complete!");
111123
});
112124

@@ -116,20 +128,20 @@ describe("nexus-repository", async () => {
116128
agent_id: "test-agent",
117129
nexus_url: "invalid-url",
118130
nexus_password: "test-token",
119-
package_managers: JSON.stringify({})
120-
})
131+
package_managers: JSON.stringify({}),
132+
}),
121133
).rejects.toThrow();
122134
});
123135

124136
it("validates username_field values", async () => {
125137
await expect(
126138
runTerraformApply(import.meta.dir, {
127-
agent_id: "test-agent",
139+
agent_id: "test-agent",
128140
nexus_url: "https://nexus.example.com",
129141
nexus_password: "test-token",
130142
username_field: "invalid",
131-
package_managers: JSON.stringify({})
132-
})
143+
package_managers: JSON.stringify({}),
144+
}),
133145
).rejects.toThrow();
134146
});
135-
});
147+
});

registry/mavrickrishi/modules/nexus-repository/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ else
102102
not_configured docker
103103
fi
104104

105-
echo "✅ Nexus repository configuration completed!"
105+
echo "✅ Nexus repository configuration completed!"

0 commit comments

Comments
 (0)