Skip to content

Commit

Permalink
Add test for duplicate properties
Browse files Browse the repository at this point in the history
Adds a test that covers duplicate property reporting
  • Loading branch information
gorkem committed Jan 22, 2020
1 parent 20a8b07 commit 07ca6ca
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/schemaValidation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,27 @@ suite('Validation Tests', () => {

});

describe('Test with no schemas', () => {
function parseSetup(content: string) {
const testTextDocument = setupTextDocument(content);
return languageService.doValidation(testTextDocument, true);
}

it('Duplicate properties are reported', done => {
languageService.configure({
validate: true,
isKubernetes: true
});
const content = 'kind: a\ncwd: b\nkind: c';
const validator = parseSetup(content);
validator.then(function (result) {
assert.equal(result.length, 2);
assert.equal(result[1].message, 'duplicate key');
}).then(done, done);

});
});

describe('Test with custom schemas', function () {
function parseSetup(content: string) {
const testTextDocument = setupTextDocument(content);
Expand Down

0 comments on commit 07ca6ca

Please sign in to comment.