UNPKG

@davidbolaji/termii-node

Version:

Node.js SDK for Termii API – send SMS, voice, OTP, and manage messaging with ease.

21 lines (20 loc) 838 B
import { SotelService } from "../sotel/SotelService"; import { EsimService } from "../sotel/EsimService"; describe("SotelService", () => { let httpClient; let service; beforeEach(() => { httpClient = { request: jest.fn() }; service = new SotelService(httpClient); }); it("exposes EsimService via 'esim' property", () => { expect(service.esim).toBeInstanceOf(EsimService); }); it("calls underlying EsimService for fetchEsims", async () => { // spy on esim.fetchEsims const esimSpy = jest.spyOn(service.esim, "fetchEsims").mockResolvedValue({ esims: [], total: 0, page: 0, size: 0 }); const result = await service.esim.fetchEsims(); expect(esimSpy).toHaveBeenCalled(); expect(result).toEqual({ esims: [], total: 0, page: 0, size: 0 }); }); });