import { ITestDiagnosticsOptions , minimalDeploymentTemplate , testDiagnostics , testDiagnosticsFromFile } from "../support/diagnostics" ; import { testWithLanguageServer } from "../support/testWithLanguageServer" ; import { testMessages } from "../testConstants" ; suite ( "Acceptance validation tests (all sources)" , ( ) => { function createAcceptanceTest ( templatePath , options , expected ) { testWithLanguageServer ( `validation acceptance test ${ templatePath }` , async ( ) => { await testDiagnosticsFromFile ( templatePath , options , expected ) ; } ) ; } testWithLanguageServer ( "minimal deployment template - no errors" , async ( ) => { await testDiagnostics ( minimalDeploymentTemplate , { } , [ ] ) ; } ) ; createAcceptanceTest ( 'templates/new-vm.jsonc' , { includeRange : true } , [ `Warning: The parameter 'backupVaultRGIsNew' is never used. (arm-template (expressions)) [33,9-33,29]` , `Warning: The parameter 'backupContainerName' is never used. (arm-template (expressions)) [48,9-48,30]` , 'Warning: Please use https for the schema URL (arm-template (schema)) [3,16-3,96]' , testMessages . linkedTemplateNoValidation ( "Acronis.acronis-backup-lin-20180305162104" , "[197,21-197,64]" ) , testMessages . nestedTemplateNoValidation ( "[concat('BackupVaultPolicy', '-', parameters('backupVaultName'), '-', parameters('backupPolicyName'))]" , "[271,21-271,125]" ) , testMessages . nestedTemplateNoValidation ( "[concat(parameters('virtualMachineName'), '-' , 'BackupIntent')]" , "[312,21-312,87]" ) , `Warning: For full schema validation, consider updating the value to one of the following: \"2016-05-15\". It is possible that the current resource version is valid but that a schema has not been generated. For more information see https://aka.ms/arm-tools-apiversion. (arm-template (schema)) [241,13-241,25]` , `Warning: For full schema validation, consider updating the value to one of the following: \"2016-12-01\". It is possible that the current resource version is valid but that a schema has not been generated. For more information see https://aka.ms/arm-tools-apiversion. (arm-template (schema)) [294,29-294,41]` , ] ) ; createAcceptanceTest ( 'templates/language-service-p0.template.json' , { } , [ ] ) ; createAcceptanceTest ( 'templates/language-service-p0.template.new-schema.json' , { } , [ ] ) ; createAcceptanceTest ( 'templates/language-service-p1.template.json' , { } , [ `Warning: Missing required property "kind" (arm-template (schema))` , `Warning: Missing required property "sku" (arm-template (schema))` , `Warning: The parameter 'unusedParameter' is never used. (arm-template (expressions))` ] ) ; createAcceptanceTest ( 'templates/language-service-p1.template.new-schema.json' , { } , [ `Warning: Missing required property "kind" (arm-template (schema))` , `Warning: Missing required property "sku" (arm-template (schema))` , `Warning: The parameter 'unusedParameter' is never used. (arm-template (expressions))` ] ) ; createAcceptanceTest ( 'templates/udf-xmas-tree2.jsonc' , { } , [ ] ) ; } ) ;