diff --git a/tests/src/client/client.test.js b/tests/src/client/client.test.js index 735c1e8..33b18bf 100644 --- a/tests/src/client/client.test.js +++ b/tests/src/client/client.test.js @@ -1,5 +1,6 @@ const { client } = require('../../../src'); const { readFileSync } = require('fs'); +const { expect } = require('@jest/globals'); // Mocks jest.mock('discord.js'); @@ -18,10 +19,27 @@ describe('Client Tests', () => { instance = new client(config, commandConfig); expect(instance.config).toBe(config); + expect(instance.commandConfig).toBe(commandConfig); expect(instance.events).toBeDefined(); expect(instance.util).toBeDefined(); }); + test('Configure Client (Undefined: config)', () => { + expect(() => { + instance = new client(config, commandConfig); + instance._config = undefined; + instance.start(); + }).toThrow("Config has not been set"); + }); + + test('Configure Client (Undefined: Command Config)', () => { + expect(() => { + instance = new client(config, commandConfig); + instance._commandConfig = undefined; + instance.start(); + }).toThrow("Command Config has not been set"); + }); + test('Configure Client (Incorrect parameters: token)', () => { expect(() => { delete config.token; @@ -51,7 +69,9 @@ describe('Client Tests', () => { }); test('Start Client', () => { - instance = new client(config, commandConfig); - instance.start(); + expect(() => { + instance = new client(config, commandConfig); + instance.start(); + }).not.toThrow(); }); }); \ No newline at end of file