UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

40 lines 1.67 kB
// SPDX-License-Identifier: Apache-2.0 import { expect } from 'chai'; import Sinon from 'sinon'; import { GetKubeConfigRequest } from '../../../../../../src/integration/kind/request/get/get-kubeconfig-request.js'; describe('GetKubeConfigRequest', () => { let builder; let request; beforeEach(() => { // Create a stub for the builder builder = { subcommands: Sinon.stub().returnsThis(), }; }); afterEach(() => { Sinon.restore(); }); describe('apply', () => { it('should add get kubeconfig subcommands to the builder', () => { // Create request with null options request = new GetKubeConfigRequest(null); // Call the apply method request.apply(builder); // Verify the correct subcommands were added expect(builder.subcommands).to.have.been.calledOnceWith('get', 'kubeconfig'); }); it('should delegate to options.apply when options are provided', () => { // Create mock options with a stub for apply method const options = { apply: Sinon.stub() }; // Create request with options request = new GetKubeConfigRequest(options); // Call the apply method request.apply(builder); // Verify the correct subcommands were added expect(builder.subcommands).to.have.been.calledOnceWith('get', 'kubeconfig'); // Verify the options.apply method was called expect(options.apply).to.have.been.calledOnceWith(builder); }); }); }); //# sourceMappingURL=get-kubeconfig-request.test.js.map