UNPKG

1.22 kBPlain TextView Raw
1import * as postmark from "../../src/index";
2
3import { expect } from "chai";
4import "mocha";
5
6import * as nconf from "nconf";
7const testingKeys = nconf.env().file({ file: __dirname + "/../../testing_keys.json" });
8
9describe("Clients initialization", () => {
10 const serverToken: string = testingKeys.get("SERVER_TOKEN");
11
12 it("#new ServerClient", () => {
13 let client = new postmark.ServerClient(serverToken);
14 expect(client).not.to.equal(undefined);
15 });
16
17 it("#new AccountClient", () => {
18 let client = new postmark.AccountClient(serverToken);
19 expect(client).not.to.equal(undefined);
20 expect(client).to.be.instanceOf(postmark.AccountClient)
21 });
22
23 describe('legacy initialization - v1', () => {
24 it("#new Client", () => {
25 let client = new postmark.Client(serverToken);
26 expect(client).not.to.equal(undefined);
27 expect(client).to.be.instanceOf(postmark.ServerClient)
28 });
29
30 it("#new AdminClient", () => {
31 let client = new postmark.AdminClient(serverToken);
32 expect(client).not.to.equal(undefined);
33 expect(client).to.be.instanceOf(postmark.AccountClient)
34 });
35 });
36});