@davidbolaji/termii-node
Version:
Node.js SDK for Termii API – send SMS, voice, OTP, and manage messaging with ease.
25 lines (24 loc) • 941 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const SearchService_1 = require("../insights/SearchService");
describe("SearchService", () => {
let httpClient;
let service;
beforeEach(() => {
httpClient = { request: jest.fn() };
service = new SearchService_1.SearchService(httpClient);
});
it("checks phone number DND status and network", async () => {
const payload = { phone_number: "2348012345678" };
const mockResponse = {
number: "2348012345678",
status: "Active",
network: "MTN Nigeria",
network_code: "62120",
};
httpClient.request.mockResolvedValue(mockResponse);
const result = await service.checkNumber(payload);
expect(httpClient.request).toHaveBeenCalledWith("/check/dnd", { method: "GET", params: payload });
expect(result).toEqual(mockResponse);
});
});