Skip to content

Commit 07ca6ca

Browse files
committed
Add test for duplicate properties
Adds a test that covers duplicate property reporting
1 parent 20a8b07 commit 07ca6ca

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/schemaValidation.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,27 @@ suite('Validation Tests', () => {
333333

334334
});
335335

336+
describe('Test with no schemas', () => {
337+
function parseSetup(content: string) {
338+
const testTextDocument = setupTextDocument(content);
339+
return languageService.doValidation(testTextDocument, true);
340+
}
341+
342+
it('Duplicate properties are reported', done => {
343+
languageService.configure({
344+
validate: true,
345+
isKubernetes: true
346+
});
347+
const content = 'kind: a\ncwd: b\nkind: c';
348+
const validator = parseSetup(content);
349+
validator.then(function (result) {
350+
assert.equal(result.length, 2);
351+
assert.equal(result[1].message, 'duplicate key');
352+
}).then(done, done);
353+
354+
});
355+
});
356+
336357
describe('Test with custom schemas', function () {
337358
function parseSetup(content: string) {
338359
const testTextDocument = setupTextDocument(content);

0 commit comments

Comments
 (0)