chore: add type parameter for testRequiredVariables

web-rdp-cloud-fixes
Parkreiner 10 months ago
parent 264584e673
commit de00f6334f

@ -133,9 +133,9 @@ export const findResourceInstance = <T extends string>(
* Creates a test-case for each variable provided and ensures that the apply * Creates a test-case for each variable provided and ensures that the apply
* fails without it. * fails without it.
*/ */
export const testRequiredVariables = ( export const testRequiredVariables = <TVars extends Record<string, string>>(
dir: string, dir: string,
vars: Record<string, string>, vars: TVars,
) => { ) => {
// Ensures that all required variables are provided. // Ensures that all required variables are provided.
it("required variables", async () => { it("required variables", async () => {

@ -1,4 +1,4 @@
import { beforeAll, describe, expect, it, test } from "bun:test"; import { describe, expect, it, test } from "bun:test";
import { import {
executeScriptInContainer, executeScriptInContainer,
runTerraformApply, runTerraformApply,
@ -13,20 +13,20 @@ type TestVariables = Readonly<{
admin_password?: string; admin_password?: string;
}>; }>;
describe("Web RDP", () => { describe("Web RDP", async () => {
beforeAll(async () => {
await runTerraformInit(import.meta.dir); await runTerraformInit(import.meta.dir);
testRequiredVariables(import.meta.dir, { testRequiredVariables<TestVariables>(import.meta.dir, {
agent_id: "foo", agent_id: "foo",
resource_id: "bar", resource_id: "bar",
}); });
});
it("Installs the Devolutions Gateway Angular app locally on the machine", async () => { it("Installs the Devolutions Gateway Angular app locally on the machine", async () => {
const state = await runTerraformApply<TestVariables>(import.meta.dir, { const state = await runTerraformApply<TestVariables>(import.meta.dir, {
agent_id: "foo", agent_id: "foo",
resource_id: "bar", resource_id: "bar",
}); });
throw new Error("Not implemented yet");
}); });
/** /**

Loading…
Cancel
Save