codify-plugin-test 0.0.53-beta2 → 0.0.53-beta21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin-process.d.ts +5 -0
- package/dist/plugin-process.js +23 -21
- package/dist/plugin-process.js.map +1 -1
- package/dist/plugin-tester.d.ts +1 -0
- package/dist/plugin-tester.js +59 -7
- package/dist/plugin-tester.js.map +1 -1
- package/dist/spawn.d.ts +1 -0
- package/dist/spawn.js +11 -2
- package/dist/spawn.js.map +1 -1
- package/dist/test-utils.d.ts +39 -1
- package/dist/test-utils.js +98 -2
- package/dist/test-utils.js.map +1 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +22 -1
- package/dist/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/plugin-process.ts +15 -20
- package/src/plugin-tester.ts +79 -15
- package/src/spawn.ts +6 -2
- package/src/test-utils.test.ts +5 -5
- package/src/test-utils.ts +116 -2
- package/src/utils.ts +25 -2
- package/test/plugin-tester.test.ts +19 -8
- package/test/test-plugin.ts +34 -5
- package/tsconfig.json +1 -2
package/test/test-plugin.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CreatePlan,
|
|
3
|
-
DestroyPlan,
|
|
3
|
+
DestroyPlan,
|
|
4
|
+
ModifyPlan,
|
|
4
5
|
ParameterChange,
|
|
5
6
|
Plugin,
|
|
6
7
|
Resource,
|
|
7
8
|
ResourceSettings,
|
|
8
9
|
runPlugin
|
|
9
10
|
} from 'codify-plugin-lib';
|
|
10
|
-
import { StringIndexedObject } from 'codify-schemas';
|
|
11
|
-
import { b } from 'vitest/dist/reporters-yx5ZTtEV';
|
|
11
|
+
import { OS, StringIndexedObject } from 'codify-schemas';
|
|
12
12
|
import * as fs from 'node:fs';
|
|
13
13
|
|
|
14
14
|
export interface TestConfig extends StringIndexedObject {
|
|
@@ -27,6 +27,7 @@ export class TestResource extends Resource<TestConfig> {
|
|
|
27
27
|
getSettings(): ResourceSettings<TestConfig> {
|
|
28
28
|
return {
|
|
29
29
|
id: 'test',
|
|
30
|
+
operatingSystems: [OS.Linux, OS.Darwin],
|
|
30
31
|
allowMultiple: true,
|
|
31
32
|
};
|
|
32
33
|
}
|
|
@@ -54,6 +55,7 @@ export class TestResource2 extends Resource<TestConfig2> {
|
|
|
54
55
|
getSettings(): ResourceSettings<TestConfig2> {
|
|
55
56
|
return {
|
|
56
57
|
id: 'test2',
|
|
58
|
+
operatingSystems: [OS.Linux, OS.Darwin],
|
|
57
59
|
parameterSettings: {
|
|
58
60
|
propB: { type: 'array' }
|
|
59
61
|
}
|
|
@@ -82,7 +84,8 @@ export class TestUninstallResource extends Resource<TestConfig> {
|
|
|
82
84
|
first = true;
|
|
83
85
|
getSettings(): ResourceSettings<TestConfig> {
|
|
84
86
|
return {
|
|
85
|
-
id: 'test-uninstall'
|
|
87
|
+
id: 'test-uninstall',
|
|
88
|
+
operatingSystems: [OS.Linux, OS.Darwin],
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
|
|
@@ -106,6 +109,7 @@ export class TestModifyResource extends Resource<TestConfig> {
|
|
|
106
109
|
getSettings(): ResourceSettings<TestConfig> {
|
|
107
110
|
return {
|
|
108
111
|
id: 'test-modify',
|
|
112
|
+
operatingSystems: [OS.Linux, OS.Darwin],
|
|
109
113
|
parameterSettings: {
|
|
110
114
|
propA: { type: 'string', canModify: true },
|
|
111
115
|
propB: { type: 'string', canModify: true },
|
|
@@ -141,6 +145,7 @@ export class TestDestroyResource extends Resource<TestConfig> {
|
|
|
141
145
|
getSettings(): ResourceSettings<TestConfig> {
|
|
142
146
|
return {
|
|
143
147
|
id: 'test-destroy',
|
|
148
|
+
operatingSystems: [OS.Linux, OS.Darwin],
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
|
|
@@ -165,6 +170,29 @@ export class TestDestroyResource extends Resource<TestConfig> {
|
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
|
|
173
|
+
export class WindowsOnlyResource extends Resource<TestConfig> {
|
|
174
|
+
private name: string;
|
|
175
|
+
|
|
176
|
+
getSettings(): ResourceSettings<TestConfig> {
|
|
177
|
+
return {
|
|
178
|
+
id: 'windows-only',
|
|
179
|
+
operatingSystems: [OS.Windows],
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async refresh(parameters: Partial<TestConfig>): Promise<Array<Partial<TestConfig>> | Partial<TestConfig> | null> {
|
|
184
|
+
return {};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
async modify(pc: ParameterChange<TestConfig>, plan: ModifyPlan<TestConfig>): Promise<void> {
|
|
188
|
+
return super.modify(pc, plan);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async create(plan: CreatePlan<TestConfig>): Promise<void> {}
|
|
192
|
+
|
|
193
|
+
async destroy(plan: DestroyPlan<TestConfig>): Promise<void> {}
|
|
194
|
+
}
|
|
195
|
+
|
|
168
196
|
export class TestDestroyResource2 extends TestDestroyResource {
|
|
169
197
|
getSettings(): ResourceSettings<TestConfig> {
|
|
170
198
|
return {
|
|
@@ -181,6 +209,7 @@ runPlugin(Plugin.create(
|
|
|
181
209
|
new TestUninstallResource(),
|
|
182
210
|
new TestModifyResource(),
|
|
183
211
|
new TestDestroyResource(),
|
|
184
|
-
new TestDestroyResource2()
|
|
212
|
+
new TestDestroyResource2(),
|
|
213
|
+
new WindowsOnlyResource(),
|
|
185
214
|
]
|
|
186
215
|
));
|
package/tsconfig.json
CHANGED
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
"resolveJsonModule": true,
|
|
8
8
|
"alwaysStrict": true,
|
|
9
9
|
"noImplicitAny": true,
|
|
10
|
-
"removeComments": true,
|
|
11
10
|
"strictNullChecks": true,
|
|
12
11
|
"declaration": true,
|
|
13
12
|
"emitDecoratorMetadata": true,
|
|
14
13
|
"experimentalDecorators": true,
|
|
15
14
|
"rootDir": "src",
|
|
16
|
-
"outDir": "./dist"
|
|
15
|
+
"outDir": "./dist",
|
|
17
16
|
},
|
|
18
17
|
"exclude": [
|
|
19
18
|
"node_modules",
|