Skip to content

Commit

Permalink
Restores a stub, which breaks other test files
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
  • Loading branch information
konstantinabl committed Jan 24, 2024
1 parent abe8a97 commit d8d64b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/unit/controller/StateController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ describe('StateController', () => {
describe('should handle other events correctly', () => {
let stateController: StateController;
let getStartConfigurationStub: sinon.SinonStub;
let getStub1;

before(() => {
const loggerServiceStub = sinon.createStubInstance(LoggerService);
const cliServiceStub = sinon.createStubInstance(CLIService);

// Stub the first call to ServiceLocator.Current.get
const getStub1 = sinon.stub(ServiceLocator.Current, 'get');
getStub1 = sinon.stub(ServiceLocator.Current, 'get');
getStub1.onFirstCall().returns(loggerServiceStub);
getStub1.onSecondCall().returns(cliServiceStub);
getStub1.onThirdCall().returns(loggerServiceStub);
Expand All @@ -111,6 +112,7 @@ describe('StateController', () => {
after(() => {
// Restore the original ServiceLocator after each test
getStartConfigurationStub.restore();
getStub1.restore();
});

it('should handle other events correctly', async () => {
Expand Down
1 change: 0 additions & 1 deletion test/unit/states/AccountCreationState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { LoggerService } from '../../../src/services/LoggerService';
import { CLIService } from '../../../src/services/CLIService'
import { ClientService } from '../../../src/services/ClientService';
import { ServiceLocator } from '../../../src/services/ServiceLocator';
import { StateController } from '../../../src/controller/StateController';
import { PrivateKey } from '@hashgraph/sdk';

describe('AccountCreationState', () => {
Expand Down

0 comments on commit d8d64b4

Please sign in to comment.