From 87c00a202edc06aab7a2a60c58aa3d2739b85e09 Mon Sep 17 00:00:00 2001 From: Stephen Kirby Date: Tue, 26 Sep 2023 19:38:58 +0000 Subject: [PATCH] added test --- fly-region/README.md | 1 - fly-region/main.test.ts | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 fly-region/main.test.ts diff --git a/fly-region/README.md b/fly-region/README.md index 03a3502..6013a79 100644 --- a/fly-region/README.md +++ b/fly-region/README.md @@ -63,4 +63,3 @@ module "fly-region" { ## Associated template For a pre-configured Fly.io template, see the Coder template registry. - diff --git a/fly-region/main.test.ts b/fly-region/main.test.ts new file mode 100644 index 0000000..26af776 --- /dev/null +++ b/fly-region/main.test.ts @@ -0,0 +1,25 @@ +import { describe, expect, it } from "bun:test"; +import { + executeScriptInContainer, + runTerraformApply, + runTerraformInit, + testRequiredVariables, +} from "../test"; + +describe("azure-region", async () => { + await runTerraformInit(import.meta.dir); + + testRequiredVariables(import.meta.dir, {}); + + it("default output", async () => { + const state = await runTerraformApply(import.meta.dir, {}); + expect(state.outputs.value.value).toBe("ams"); + }); + + it("customized default", async () => { + const state = await runTerraformApply(import.meta.dir, { + default: "atl", + }); + expect(state.outputs.value.value).toBe("atl"); + }); +});