1 | import * as postmark from "../../src/index";
|
2 |
|
3 | import { expect } from "chai";
|
4 | import "mocha";
|
5 |
|
6 | import * as nconf from "nconf";
|
7 | const testingKeys = nconf.env().file({ file: __dirname + "/../../testing_keys.json" });
|
8 |
|
9 | describe("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 | });
|