Skip to content

Commit

Permalink
Added testing for converting millis to minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
mj52951 committed Oct 5, 2023
1 parent 7d974f9 commit acc871d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/monitoringService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import sinon, { SinonStubbedInstance } from "sinon"
import TransferRepository from "../../src/indexer/repository/transfer"
import { checkTransferStatus, createMessage } from "../../src/indexer/services/monitoringService"
import { NotificationSender } from "../../src/indexer/services/monitoringService/notificationSender"
import { convertMillisecondsToMinutes } from "../../src/utils/helpers"

describe("Monitoring service testing", function () {
let notificationSenderStub: SinonStubbedInstance<NotificationSender>
Expand Down Expand Up @@ -198,4 +199,10 @@ describe("Monitoring service testing", function () {

expect(notificationSenderStub.sendNotification.calledOnce).to.be.false
})

it("Should successfully convert milliseconds to minutes", () => {
expect(convertMillisecondsToMinutes(900000)).to.be.deep.equal(15)
expect(convertMillisecondsToMinutes(2700000)).to.be.deep.equal(45)
expect(convertMillisecondsToMinutes(3600000)).to.be.deep.equal(60)
})
})

0 comments on commit acc871d

Please sign in to comment.