From 6dbf96db61f2febea4ecb49f812406445a07f686 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 21 Jul 2020 15:34:30 -0400 Subject: [PATCH] Remove gitlab schema dependency Signed-off-by: Josh Pinkney --- test/schemaValidation.test.ts | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/test/schemaValidation.test.ts b/test/schemaValidation.test.ts index 0d6b4366..f97b536f 100644 --- a/test/schemaValidation.test.ts +++ b/test/schemaValidation.test.ts @@ -638,16 +638,28 @@ suite('Validation Tests', () => { }); }); - describe.skip('Test anchors specifically against gitlab schema', function () { - it('Test that anchors do not report Property << is not allowed', done => { - languageService.configure({ - schemas: [{ - uri: 'https://json.schemastore.org/gitlab-ci', - fileMatch: ['*.yaml', '*.yml'] - }], - validate: true - }); - const content = '.test-cache: &test-cache\n cache: {}\nnodejs-tests:\n <<: *test-cache\n script: test'; + describe('Test anchors', function () { + it('Test that anchors with a schema do not report Property << is not allowed', done => { + const schema = { + 'type': 'object', + 'properties': { + 'sample': { + 'type': 'object', + 'properties': { + 'prop1': { + 'type': 'string' + }, + 'prop2': { + 'type': 'string' + } + }, + 'additionalProperties': false + } + }, + '$schema': 'http://json-schema.org/draft-07/schema#' + }; + languageService.addSchema(SCHEMA_ID, schema); + const content = 'test: &test\n prop1: hello\nsample:\n <<: *test\n prop2: another_test'; const validator = parseSetup(content); validator.then(function (result) { assert.equal(result.length, 0);