Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 264584e

Browse files
committed
fix: make comments for test helpers exportable
1 parent 83ecba2 commit 264584e

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

test.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ export const runContainer = async (
2929
return containerID.trim();
3030
};
3131

32-
// executeScriptInContainer finds the only "coder_script"
33-
// resource in the given state and runs it in a container.
32+
/**
33+
* Finds the only "coder_script" resource in the given state and runs it in a
34+
* container.
35+
*/
3436
export const executeScriptInContainer = async (
3537
state: TerraformState,
3638
image: string,
@@ -100,10 +102,11 @@ export interface CoderScriptAttributes {
100102
url: string;
101103
}
102104

103-
// findResourceInstance finds the first instance of the given resource
104-
// type in the given state. If name is specified, it will only find
105-
// the instance with the given name.
106-
export const findResourceInstance = <T extends "coder_script" | string>(
105+
/**
106+
* finds the first instance of the given resource type in the given state. If
107+
* name is specified, it will only find the instance with the given name.
108+
*/
109+
export const findResourceInstance = <T extends string>(
107110
state: TerraformState,
108111
type: T,
109112
name?: string,
@@ -126,9 +129,10 @@ export const findResourceInstance = <T extends "coder_script" | string>(
126129
return resource.instances[0].attributes as any;
127130
};
128131

129-
// testRequiredVariables creates a test-case
130-
// for each variable provided and ensures that
131-
// the apply fails without it.
132+
/**
133+
* Creates a test-case for each variable provided and ensures that the apply
134+
* fails without it.
135+
*/
132136
export const testRequiredVariables = (
133137
dir: string,
134138
vars: Record<string, string>,
@@ -160,9 +164,11 @@ export const testRequiredVariables = (
160164
});
161165
};
162166

163-
// runTerraformApply runs terraform apply in the given directory
164-
// with the given variables. It is fine to run in parallel with
165-
// other instances of this function, as it uses a random state file.
167+
/**
168+
* Runs terraform apply in the given directory with the given variables. It is
169+
* fine to run in parallel with other instances of this function, as it uses a
170+
* random state file.
171+
*/
166172
export const runTerraformApply = async <
167173
TVars extends Readonly<Record<string, string>>,
168174
>(
@@ -200,7 +206,9 @@ export const runTerraformApply = async <
200206
return JSON.parse(content);
201207
};
202208

203-
// runTerraformInit runs terraform init in the given directory.
209+
/**
210+
* Runs terraform init in the given directory.
211+
*/
204212
export const runTerraformInit = async (dir: string) => {
205213
const proc = spawn(["terraform", "init"], {
206214
cwd: dir,

0 commit comments

Comments
 (0)