Skip to content

Commit

Permalink
Update: comments and test fix for BaseConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
stokes-christopher committed May 24, 2022
1 parent cee4c87 commit cd8a797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/api/conversation/Conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import {InvalidValueError} from "../../error";

export class Conversation {


/**
* @ignore
*/
protected conversationId: string;

/**
* Creates Conversation object with conversation id.
* @param conversationId string
*/
constructor (conversationId: string) {

if (!conversationId || typeof conversationId !== "string") {
Expand Down
4 changes: 2 additions & 2 deletions tests/connection/Connection.BaseConnection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ test(
)

test(
"BaseConnection.getConversationId() - returns when it exists",
"BaseConnection.getConversationId() - returns null when no conversation exists.",
() => {
const connection = new BaseConnection("123456678");

expect(() => connection.getConversationId()).toThrow(new NullError("There is no stored conversationId."));
expect(connection.getConversationId()).toEqual(null);
}
)

0 comments on commit cd8a797

Please sign in to comment.