11import { expect } from 'chai' ;
22import * as sinon from 'sinon' ;
3- import { configHandler } from '@contentstack/cli-utilities' ;
3+ import { configHandler , log , cliux } from '@contentstack/cli-utilities' ;
44import GetRegionCommand from '../../../src/commands/config/get/region' ;
5- import { cliux } from '@contentstack/cli-utilities' ;
65import { Region } from '../../../src/interfaces' ;
76import UserConfig from '../../../src/utils/region-handler' ;
87import { askCustomRegion , askRegions } from '../../../src/utils/interactive' ;
@@ -51,10 +50,6 @@ describe('Region command', function () {
5150 // Stub the exit method to throw to stop execution
5251 const exitStub = sinon . stub ( command , 'exit' ) . throws ( new Error ( 'EXIT_CALLED' ) ) ;
5352
54- // Mock the logger with error method
55- const loggerErrorStub = sinon . stub ( ) ;
56- command . logger = { error : loggerErrorStub } as any ;
57-
5853 // Stub cliux.error to capture error calls
5954 const errorStub = sinon . stub ( cliux , 'error' ) ;
6055
@@ -68,10 +63,7 @@ describe('Region command', function () {
6863 // Expected to throw due to exit stub
6964 }
7065
71- // Verify that logger.error was called
72- expect ( loggerErrorStub . calledWith ( 'No region is set.' ) ) . to . be . true ;
73-
74- // Verify that cliux.error was called
66+ // Verify that cliux.error was called with the correct message
7567 expect ( errorStub . calledWith ( 'CLI_CONFIG_GET_REGION_NOT_FOUND' ) ) . to . be . true ;
7668
7769 // Verify exit was called
0 commit comments