Skip to content

Commit

Permalink
modify test
Browse files Browse the repository at this point in the history
  • Loading branch information
William-De71 committed Nov 10, 2024
1 parent 4cc2736 commit 446987d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/test/services/free-mobile/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('free-mobile', () => {
afterEach(() => {
axiosPostStub.restore();
loggerErrorStub.restore();
sinon.restore();
});

describe('start', () => {
Expand Down Expand Up @@ -72,6 +73,8 @@ describe('free-mobile', () => {
await freeMobileService.start();
await freeMobileService.sms.send('Hello World');

expect(axiosPostStub.calledOnce).to.equal(true);

const callArgs = axiosPostStub.getCall(0).args;
expect(callArgs[0]).to.equal('https://smsapi.free-mobile.fr/sendmsg');
expect(callArgs[1]).to.deep.equal({
Expand All @@ -93,6 +96,8 @@ describe('free-mobile', () => {
await freeMobileService.start();
await freeMobileService.sms.send('Hello World');

expect(loggerErrorStub.calledOnce).to.equal(true);

const errorArgs = loggerErrorStub.getCall(0).args;
expect(errorArgs[0]).to.equal('Error sending SMS:');
expect(errorArgs[1]).to.be.instanceOf(Error);
Expand Down

0 comments on commit 446987d

Please sign in to comment.