From c4dc4572fd1bc7d8faea2912f3632ea923a6171d Mon Sep 17 00:00:00 2001 From: Anthony Martin Date: Mon, 20 Sep 2021 15:14:50 -0400 Subject: [PATCH] Update tests.ts --- tools/tests.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/tests.ts b/tools/tests.ts index 92e8bb2f2d..8e6deb79f8 100644 --- a/tools/tests.ts +++ b/tools/tests.ts @@ -7,7 +7,6 @@ import { promisify } from 'util'; import { getLanguageService } from 'vscode-json-languageservice'; import { TextDocument } from 'vscode-languageserver-types'; import draft4MetaSchema from 'ajv/lib/refs/json-schema-draft-04.json'; -import draft7MetaSchema from 'ajv/lib/refs/json-schema-draft-07.json'; import * as schemaTestsRunner from './schemaTestsRunner'; import 'mocha'; import { findCycle } from './cycleCheck'; @@ -20,15 +19,13 @@ const testSchemasFolder = __dirname + '/schemas/'; const templateTestsFolder = __dirname + '/templateTests/'; const armSchemasPrefix = /^https?:\/\/schema\.management\.azure\.com\/schemas\// const jsonSchemaDraft4Prefix = /^https?:\/\/json-schema\.org\/draft-04\/schema/ -const jsonSchemaDraft7Prefix = /^https?:\/\/json-schema\.org\/draft-07\/schema/ const ajvInstance = new Ajv({ loadSchema: loadSchema, strictDefaults: true, schemaId: 'id', - meta: false + meta: true, }).addMetaSchema(draft4MetaSchema) - .addMetaSchema(draft7MetaSchema) .addFormat('int32', /.*/) .addFormat('duration', /.*/) .addFormat('password', /.*/); @@ -46,9 +43,6 @@ async function loadRawSchema(uri: string) : Promise { else if (uri.match(jsonSchemaDraft4Prefix)) { return JSON.stringify(draft4MetaSchema); } - else if (uri.match(jsonSchemaDraft7Prefix)) { - return JSON.stringify(draft7MetaSchema); - } else { jsonPath = uri; } @@ -91,7 +85,6 @@ function listSchemaPaths(basePath: string): string[] { const metaSchemaPaths = [ 'http://json-schema.org/draft-04/schema', - 'http://json-schema.org/draft-07/schema', testSchemasFolder + 'ResourceMetaSchema.json', ]; @@ -140,6 +133,7 @@ const schemasToSkip = [ '2019-08-01/managementGroupDeploymentTemplate.json', '2019-08-01/tenantDeploymentParameters.json', '2019-08-01/tenantDeploymentTemplate.json', + '2021-09-09/uiFormDefinition.schema.json', 'common/definitions.json', 'common/manuallyAddedResources.json', 'common/autogeneratedResources.json', @@ -235,4 +229,4 @@ describe('Validate test templates against VSCode language service', () => { expect(result).to.deep.equal([]); }); } -}); \ No newline at end of file +});