Skip to content

Commit

Permalink
fix: fixed utils.spec.ts
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
  • Loading branch information
quiet-node committed Feb 1, 2025
1 parent 357c68d commit 95380a8
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions packages/relay/tests/lib/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,10 @@ describe('Utils', () => {
OPERATOR_KEY_MAIN: null,
},
() => {
it('should return null and log a warning if operatorKey is missing', () => {
const warnSpy = sinon.spy(logger, 'warn');

const operator = Utils.getOperator(logger);

expect(operator).to.be.null;
expect(warnSpy.calledOnce).to.be.true;
expect(warnSpy.firstCall.args[0]).to.equal('Invalid operatorId or operatorKey for main client.');
warnSpy.restore();
it('should throw error if OPERATOR_KEY_MAIN is missing', () => {
expect(() => Utils.getOperator(logger)).to.throw(
'Configuration error: OPERATOR_KEY_MAIN is a mandatory configuration for relay operation.',
);
});
},
);
Expand All @@ -199,15 +194,10 @@ describe('Utils', () => {
OPERATOR_KEY_MAIN: privateKeys[0].keyValue,
},
() => {
it('should return null and log a warning if operatorId is missing', () => {
const warnSpy = sinon.spy(logger, 'warn');

const operator = Utils.getOperator(logger);

expect(operator).to.be.null;
expect(warnSpy.calledOnce).to.be.true;
expect(warnSpy.firstCall.args[0]).to.equal('Invalid operatorId or operatorKey for main client.');
warnSpy.restore();
it('should throw error if OPERATOR_ID_MAIN is missing', () => {
expect(() => Utils.getOperator(logger)).to.throw(
'Configuration error: OPERATOR_ID_MAIN is a mandatory configuration for relay operation.',
);
});
},
);
Expand Down

0 comments on commit 95380a8

Please sign in to comment.