Files
ry.kazcloud.dev/node_modules/yaml-language-server/out/server/test/telemetry.test.js
Ryan Kazokas d181f77fb2
All checks were successful
Build and Push / build (push) Successful in 55s
Updates dockerfile
2026-02-16 15:09:37 -05:00

36 lines
1.7 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Red Hat. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const sinon = require("sinon");
const sinonChai = require("sinon-chai");
const chai = require("chai");
const schemaUrls_1 = require("../src/languageservice/utils/schemaUrls");
const telemetry_1 = require("../src/languageserver/telemetry");
const vscode_uri_1 = require("vscode-uri");
const expect = chai.expect;
chai.use(sinonChai);
describe('Telemetry Tests', () => {
const sandbox = sinon.createSandbox();
let telemetry;
beforeEach(() => {
const telemetryInstance = new telemetry_1.TelemetryImpl({});
telemetry = sandbox.stub(telemetryInstance);
});
afterEach(() => {
sandbox.restore();
});
describe('Kubernetos schema mapping', () => {
it('should not report if schema is not k8s', () => {
(0, schemaUrls_1.checkSchemaURI)([], vscode_uri_1.URI.parse('file:///some/path'), 'file:///some/path/to/schema.json', telemetry);
expect(telemetry.send).not.called;
});
it('should report if schema is k8s', () => {
(0, schemaUrls_1.checkSchemaURI)([], vscode_uri_1.URI.parse('file:///some/path'), 'kubernetes', telemetry);
expect(telemetry.send).calledOnceWith({ name: 'yaml.schema.configured', properties: { kubernetes: true } });
});
});
});
//# sourceMappingURL=telemetry.test.js.map