UNPKG

@jesseditson/dnsimple

Version:

A Node.JS client for the DNSimple API.

36 lines (35 loc) 1.7 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const nock = require("nock"); const util_1 = require("./util"); const dnsimple = (0, util_1.createTestClient)(); describe("accounts", () => { describe("#listAccounts", () => { it("produces an account list", () => __awaiter(void 0, void 0, void 0, function* () { nock("https://api.dnsimple.com") .get("/v2/accounts") .reply((0, util_1.readFixtureAt)("listAccounts/success-account.http")); const result = yield dnsimple.accounts.listAccounts(); expect(result).toEqual({ data: [ { id: 123, email: "john@example.com", plan_identifier: "dnsimple-personal", created_at: "2011-09-11T17:15:58Z", updated_at: "2016-06-03T15:02:26Z", }, ], }); })); }); });