@@ -9,14 +9,19 @@ describe('Smoke test suite', function () {
99 const DIAGNOSTICS_DELAY = 4_000 ;
1010
1111 const SCHEMA_INSTANCE_NAME = 'references-schema.yaml' ;
12+ const THROUGH_SETTINGS_NAME = 'references-schema-settings.yaml' ;
1213
1314 let schemaInstanceUri : URI ;
15+ let throughSettingsUri : URI ;
1416
1517 before ( async function ( ) {
1618 const workspaceUri = vscode . workspace . workspaceFolders [ 0 ] . uri ;
1719 schemaInstanceUri = workspaceUri . with ( {
1820 path : workspaceUri . path + ( workspaceUri . path . endsWith ( '/' ) ? '' : '/' ) + SCHEMA_INSTANCE_NAME ,
1921 } ) ;
22+ throughSettingsUri = workspaceUri . with ( {
23+ path : workspaceUri . path + ( workspaceUri . path . endsWith ( '/' ) ? '' : '/' ) + THROUGH_SETTINGS_NAME ,
24+ } ) ;
2025 } ) ;
2126
2227 it ( 'has right diagnostics when schema is referenced through a comment' , async function ( ) {
@@ -28,4 +33,14 @@ describe('Smoke test suite', function () {
2833 assert . strictEqual ( diagnostics . length , 1 ) ;
2934 assert . strictEqual ( diagnostics [ 0 ] . message , 'Value is below the minimum of 0.' ) ;
3035 } ) ;
36+
37+ it ( 'has right diagnostics when schema is referenced through settings' , async function ( ) {
38+ const textDocument = await vscode . workspace . openTextDocument ( throughSettingsUri ) ;
39+ await vscode . window . showTextDocument ( textDocument ) ;
40+ await new Promise ( ( resolve ) => setTimeout ( resolve , DIAGNOSTICS_DELAY ) ) ;
41+ const diagnostics = vscode . languages . getDiagnostics ( throughSettingsUri ) ;
42+
43+ assert . strictEqual ( diagnostics . length , 1 ) ;
44+ assert . strictEqual ( diagnostics [ 0 ] . message , 'Value is below the minimum of 0.' ) ;
45+ } ) ;
3146} ) ;
0 commit comments