1
1
import { describe , expect , it , test } from "bun:test" ;
2
2
import {
3
- JsonValue ,
4
3
TerraformState ,
5
4
executeScriptInContainer ,
6
5
runTerraformApply ,
@@ -38,20 +37,19 @@ describe("Web RDP", async () => {
38
37
39
38
it ( "Injects Terraform's username and password into the JS patch file" , async ( ) => {
40
39
const findInstancesScript = ( state : TerraformState ) : string | null => {
41
- let instancesScript : string | null = null ;
42
40
for ( const resource of state . resources ) {
43
41
if ( resource . type !== "coder_script" ) {
44
42
continue ;
45
43
}
46
44
47
45
for ( const instance of resource . instances ) {
48
46
if ( instance . attributes . display_name === "windows-rdp" ) {
49
- instancesScript = instance . attributes . script ;
47
+ return instance . attributes . script as string ;
50
48
}
51
49
}
52
50
}
53
51
54
- return instancesScript ;
52
+ return null ;
55
53
} ;
56
54
57
55
/**
@@ -61,7 +59,7 @@ describe("Web RDP", async () => {
61
59
* Tried going through the trouble of extracting out the form entries
62
60
* variable from the main output, converting it from Prettier/JS-based JSON
63
61
* 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.
65
63
*
66
64
* Written and tested via Regex101
67
65
* @see {@link https://regex101.com/r/UMgQpv/2 }
0 commit comments