1 | import Credentials from "../lib/Credentials";
|
2 | import HttpClient from "../lib/HttpClient";
|
3 | import NullLogger from "../lib/ConsoleLogger.js";
|
4 |
|
5 | import sinon from "sinon";
|
6 | import chai, { expect } from "chai";
|
7 | import sinonChai from "sinon-chai";
|
8 | import nexmoChai from "./NexmoChai";
|
9 | chai.use(sinonChai);
|
10 | chai.use(nexmoChai);
|
11 |
|
12 | const TestUtils = {
|
13 | getCredentials: function() {
|
14 | var creds = Credentials.parse({
|
15 | apiKey: "myKey",
|
16 | apiSecret: "mySecret"
|
17 | });
|
18 |
|
19 |
|
20 | creds.generateJwt = function() {
|
21 | return "ThisIsAJWT";
|
22 | };
|
23 |
|
24 | return creds;
|
25 | },
|
26 | getHttpClient: function() {
|
27 | const httpClient = new HttpClient(
|
28 | {
|
29 | logger: new NullLogger()
|
30 | },
|
31 | this.getCredentials()
|
32 | );
|
33 |
|
34 | return httpClient;
|
35 | }
|
36 | };
|
37 |
|
38 | export { TestUtils, expect, sinon };
|