Skip to content

Commit 67c02a6

Browse files
committed
Made options optional and removed detached (breaking ssh)
1 parent cf016d3 commit 67c02a6

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codify-plugin-test",
3-
"version": "0.0.15",
3+
"version": "0.0.18",
44
"description": "",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",

src/plugin-tester.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class PluginTester {
5050
[],
5151
{
5252
// Use default true to test plugins in secure mode (un-able to request sudo directly)
53-
detached: true,
53+
// detached: true,
5454
env: { ...process.env },
5555
execArgv: ['--import', 'tsx/esm', '--inspect=9221'],
5656
},
@@ -61,16 +61,16 @@ export class PluginTester {
6161

6262
async fullTest(
6363
configs: ResourceConfig[],
64-
{
65-
skipUninstall = false,
66-
...options
67-
}: {
68-
skipUninstall: boolean,
64+
options?: {
65+
skipUninstall?: boolean,
6966
validatePlan?: (plans: PlanResponseData[]) => Promise<void> | void
7067
validateApply?: (plans: PlanResponseData[]) => Promise<void> | void,
7168
validateDestroy?: (plans: PlanResponseData[]) => Promise<void> | void,
7269
validateImport?: (importResults: (ImportResponseData['result'][0])[]) => Promise<void> | void,
7370
}): Promise<void> {
71+
const {
72+
skipUninstall = false,
73+
} = options ?? {}
7474

7575
const initializeResult = await this.initialize();
7676

@@ -97,7 +97,7 @@ export class PluginTester {
9797
}));
9898
}
9999

100-
if (options.validatePlan) {
100+
if (options?.validatePlan) {
101101
await options.validatePlan(plans);
102102
}
103103

@@ -124,7 +124,7 @@ ${JSON.stringify(unsuccessfulPlans, null, 2)}`
124124
)
125125
}
126126

127-
if (options.validateApply) {
127+
if (options?.validateApply) {
128128
await options.validateApply(plans);
129129
}
130130

@@ -146,7 +146,7 @@ ${JSON.stringify(unsuccessfulPlans, null, 2)}`
146146
${JSON.stringify(unsuccessfulImports, null, 2)}`);
147147
}
148148

149-
if (options.validateImport) {
149+
if (options?.validateImport) {
150150
await options.validateImport(importResults.map((r) => r.result[0]));
151151
}
152152

@@ -155,7 +155,7 @@ ${JSON.stringify(unsuccessfulImports, null, 2)}`);
155155
}
156156
}
157157

158-
async uninstall(configs: ResourceConfig[], options: {
158+
async uninstall(configs: ResourceConfig[], options?: {
159159
validateDestroy?: (plans: PlanResponseData[]) => Promise<void> | void
160160
}) {
161161
const plans = [];
@@ -193,7 +193,7 @@ ${JSON.stringify(validationPlan, null, 2)}
193193
}
194194
}
195195

196-
if (options.validateDestroy) {
196+
if (options?.validateDestroy) {
197197
await options.validateDestroy(plans);
198198
}
199199
}

0 commit comments

Comments
 (0)