Skip to content

Commit

Permalink
fix: Integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schw4rzlicht committed Jun 12, 2020
1 parent d7c9103 commit 61194d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions __tests__/Twitch2Ma.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ test("Telnet connection failed", async () => {
twitch2Ma.onTelnetConnected(spyOnOnTelnetConnected);
twitch2Ma.onTwitchConnected(spyOnOnTwitchConnected);

await expect(twitch2Ma.start()).rejects.toThrow(new TelnetError("Could not connect to desk!"));
await expect(twitch2Ma.start()).rejects.toThrow(new TelnetError("Could not connect to desk! Check Telnet enabled, " +
"MA IP address and firewall settings if using onPC!"));

expect(spyOnOnTelnetConnected).not.toBeCalled();
expect(spyOnOnTwitchConnected).not.toBeCalled();
Expand All @@ -72,7 +73,7 @@ test("Telnet login failed", async () => {
twitch2Ma.onTwitchConnected(spyOnOnTwitchConnected);

await expect(twitch2Ma.start()).rejects
.toThrow(new TelnetError(`Could not log into the desk as user ${config.ma.user}!`));
.toThrow(new TelnetError(`Could not log into the desk as user ${config.ma.user}! Check password!`));

expect(spyOnOnTelnetConnected).not.toBeCalled();
expect(spyOnOnTwitchConnected).not.toBeCalled();
Expand Down Expand Up @@ -275,7 +276,7 @@ test("Telnet command failed", async () => {
"Alice", "!red", aliceRawMessage);

expect(twitch2Ma["telnet"].send).toBeCalledWith("Macro 1");
expect(errorHandler).toBeCalledWith(new TelnetError("Sending telnet command failed!"));
expect(errorHandler).toBeCalledWith(new TelnetError("Sending telnet command failed! Is MA still running?"));
expect(commandExecutedHandler).not.toBeCalled();
});

Expand Down

0 comments on commit 61194d8

Please sign in to comment.