codify-plugin-lib 1.0.149 → 1.0.151
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/plugin/plugin.js
CHANGED
|
@@ -121,12 +121,7 @@ export class Plugin {
|
|
|
121
121
|
return !controller.parsedSettings.allowMultiple && v > 1;
|
|
122
122
|
});
|
|
123
123
|
if (invalidMultipleConfigs.length > 0) {
|
|
124
|
-
|
|
125
|
-
resourceType: k,
|
|
126
|
-
schemaValidationErrors: [],
|
|
127
|
-
customValidationErrorMessage: `Multiple of resource type: ${k} found in configs. Only allowed 1.`,
|
|
128
|
-
isValid: false,
|
|
129
|
-
})));
|
|
124
|
+
throw new Error(`Multiples of the following configs were found but only 1 is allowed. [${invalidMultipleConfigs.map(([k, v]) => `${v}x ${k}`).join(', ')}] found.`);
|
|
130
125
|
}
|
|
131
126
|
await this.crossValidateResources(data.configs);
|
|
132
127
|
return {
|
package/package.json
CHANGED
|
@@ -482,13 +482,12 @@ describe('Plugin tests', () => {
|
|
|
482
482
|
|
|
483
483
|
const testPlugin = Plugin.create('testPlugin', [resource as any]);
|
|
484
484
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
expect(validate1.resourceValidations.every((r) => r.isValid)).to.be.false;
|
|
485
|
+
await expect(() => testPlugin.validate({
|
|
486
|
+
configs: [{ core: { type: 'ssh-config' }, parameters: { propA: 'a' } }, {
|
|
487
|
+
core: { type: 'ssh-config' },
|
|
488
|
+
parameters: { propB: 'b' }
|
|
489
|
+
}]
|
|
490
|
+
})
|
|
491
|
+
).rejects.toThrowError();
|
|
493
492
|
})
|
|
494
493
|
});
|
package/src/plugin/plugin.ts
CHANGED
|
@@ -178,12 +178,8 @@ export class Plugin {
|
|
|
178
178
|
});
|
|
179
179
|
|
|
180
180
|
if (invalidMultipleConfigs.length > 0) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
schemaValidationErrors: [],
|
|
184
|
-
customValidationErrorMessage: `Multiple of resource type: ${k} found in configs. Only allowed 1.`,
|
|
185
|
-
isValid: false,
|
|
186
|
-
})));
|
|
181
|
+
throw new Error(
|
|
182
|
+
`Multiples of the following configs were found but only 1 is allowed. [${invalidMultipleConfigs.map(([k, v]) => `${v}x ${k}`).join(', ')}] found.`)
|
|
187
183
|
}
|
|
188
184
|
|
|
189
185
|
await this.crossValidateResources(data.configs);
|