Skip to content

Commit 6409ee2

Browse files
committed
refactor: clean up current code
1 parent 7d366ff commit 6409ee2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

windows-rdp/main.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { describe, expect, it, test } from "bun:test";
22
import {
3-
JsonValue,
43
TerraformState,
54
executeScriptInContainer,
65
runTerraformApply,
@@ -38,20 +37,19 @@ describe("Web RDP", async () => {
3837

3938
it("Injects Terraform's username and password into the JS patch file", async () => {
4039
const findInstancesScript = (state: TerraformState): string | null => {
41-
let instancesScript: string | null = null;
4240
for (const resource of state.resources) {
4341
if (resource.type !== "coder_script") {
4442
continue;
4543
}
4644

4745
for (const instance of resource.instances) {
4846
if (instance.attributes.display_name === "windows-rdp") {
49-
instancesScript = instance.attributes.script;
47+
return instance.attributes.script as string;
5048
}
5149
}
5250
}
5351

54-
return instancesScript;
52+
return null;
5553
};
5654

5755
/**
@@ -61,7 +59,7 @@ describe("Web RDP", async () => {
6159
* Tried going through the trouble of extracting out the form entries
6260
* variable from the main output, converting it from Prettier/JS-based JSON
6361
* text to universal JSON text, and exposing it as a parsed JSON value. That
64-
* got to be too much, though.
62+
* got to be a bit too much, though.
6563
*
6664
* Written and tested via Regex101
6765
* @see {@link https://regex101.com/r/UMgQpv/2}

0 commit comments

Comments
 (0)