Skip to content

Commit

Permalink
fix(tests): Test not using the new error system
Browse files Browse the repository at this point in the history
  • Loading branch information
Kathund committed Feb 18, 2024
1 parent a916344 commit 3e8b877
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
21 changes: 10 additions & 11 deletions tests/Client#getSkyblockMember.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
const { SkyblockMember } = require('../src');
const { SkyblockMember, Errors } = require('../src');
const { client } = require('./Client.js');
const { expect } = require('chai');

Expand Down Expand Up @@ -36,15 +36,14 @@ describe('Client#getSkyblockMember', async () => {
});
describe('Invalid', async () => {
describe('Never Played skyblock', async () => {
it('expect not to throw', async () => {
member = await client.getSkyblockMember('b45add7b081443909fb00aa9a3e15eb0');
});
it('should be an map', () => {
expect(member).to.be.an('map');
});
it('map should be empty', () => {
expect(member.size).to.be.equal(0);
});
it('expect to throw', async () => {
try {
member = await client.getSkyblockMember('b45add7b081443909fb00aa9a3e15eb0');
throw new Error('Expected an error to be thrown, but no error was thrown.');
} catch (error) {
expect(error.message).to.equal(Errors.NO_SKYBLOCK_PROFILES);
}
}).timeout(5000);
});
});
});
});
23 changes: 11 additions & 12 deletions tests/Client#getSkyblockProfiles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
const { SkyblockMember } = require('../src');
const { SkyblockMember, Errors } = require('../src');
const { client } = require('./Client.js');
const { expect } = require('chai');

Expand All @@ -8,7 +8,7 @@ describe('Client#getSkyblockProfiles', async () => {
describe('Valid', async () => {
describe('Random (1)', async () => {
it('expect not to throw', async () => {
profiles = await client.getSkyblockProfiles('f025c1c7f55a4ea0b8d93f47d17dfe0f');
profiles = await client.getSkyblockProfiles('28667672039044989b0019b14a2c34d6');
});
it('should be an array', () => {
expect(profiles).to.be.an('array');
Expand Down Expand Up @@ -89,15 +89,14 @@ describe('Client#getSkyblockProfiles', async () => {
});
describe('Invalid', async () => {
describe('Never played skyblock', async () => {
it('expect not to throw', async () => {
profiles = await client.getSkyblockProfiles('b45add7b081443909fb00aa9a3e15eb0');
});
it('should be an array', () => {
expect(profiles).to.be.an('array');
});
it('array should be empty', () => {
expect(profiles).to.be.empty;
});
it('expect to throw', async () => {
try {
member = await client.getSkyblockMember('b45add7b081443909fb00aa9a3e15eb0');
throw new Error('Expected an error to be thrown, but no error was thrown.');
} catch (error) {
expect(error.message).to.equal(Errors.NO_SKYBLOCK_PROFILES);
}
}).timeout(5000);
});
});
});
});

0 comments on commit 3e8b877

Please sign in to comment.