chore: add type parameter for testRequiredVariables
This commit is contained in:
4
test.ts
4
test.ts
@@ -133,9 +133,9 @@ export const findResourceInstance = <T extends string>(
|
||||
* Creates a test-case for each variable provided and ensures that the apply
|
||||
* fails without it.
|
||||
*/
|
||||
export const testRequiredVariables = (
|
||||
export const testRequiredVariables = <TVars extends Record<string, string>>(
|
||||
dir: string,
|
||||
vars: Record<string, string>,
|
||||
vars: TVars,
|
||||
) => {
|
||||
// Ensures that all required variables are provided.
|
||||
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 {
|
||||
executeScriptInContainer,
|
||||
runTerraformApply,
|
||||
@@ -13,13 +13,11 @@ type TestVariables = Readonly<{
|
||||
admin_password?: string;
|
||||
}>;
|
||||
|
||||
describe("Web RDP", () => {
|
||||
beforeAll(async () => {
|
||||
await runTerraformInit(import.meta.dir);
|
||||
testRequiredVariables(import.meta.dir, {
|
||||
agent_id: "foo",
|
||||
resource_id: "bar",
|
||||
});
|
||||
describe("Web RDP", async () => {
|
||||
await runTerraformInit(import.meta.dir);
|
||||
testRequiredVariables<TestVariables>(import.meta.dir, {
|
||||
agent_id: "foo",
|
||||
resource_id: "bar",
|
||||
});
|
||||
|
||||
it("Installs the Devolutions Gateway Angular app locally on the machine", async () => {
|
||||
@@ -27,6 +25,8 @@ describe("Web RDP", () => {
|
||||
agent_id: "foo",
|
||||
resource_id: "bar",
|
||||
});
|
||||
|
||||
throw new Error("Not implemented yet");
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user