Skip to content

Commit

Permalink
Add unit test branch path coverage for setConfig without initial opts.
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffano committed Apr 28, 2024
1 parent 7fa2f63 commit 3592e4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/mineflayer-chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ describe('mineflayer-chatgpt', function() {
this.mockBot.chatgpt.setConfig('sk-123', opts);
assert.equal(opts.model, 'gpt-3.5-turbo');
});
it('should complete and set opts when setConfig is called with undefined opts', function() {
mineflayerChatgpt.chatgpt(this.mockBot);
this.mockBot.chatgpt.setConfig('sk-123');
});
it('should call bot chat when sendMessage is called without error', async function() {
this.mockAction.expects('respond').once().withArgs(sinon.match.any, sinon.match.any, 'someplayer', 'Hello').returns('Hi there!');
mineflayerChatgpt.chatgpt(this.mockBot);
Expand Down

0 comments on commit 3592e4d

Please sign in to comment.