Improvements to tests and from testing
- Moved OP25 start outside of PDAB start callback - Added more logging - Set the pdabProcess variable to false when closing the discord client - Update test variable names - Added new WIP pdabWrappers tests to test the full wrappers as the client would
This commit is contained in:
40
client/test/pdabWrappers.test.js.bak
Normal file
40
client/test/pdabWrappers.test.js.bak
Normal file
@@ -0,0 +1,40 @@
|
||||
import { use } from 'chai';
|
||||
import chaiHttp from 'chai-http';
|
||||
const chai = use(chaiHttp)
|
||||
chai.should();
|
||||
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config()
|
||||
|
||||
import { joinDiscordVC, leaveDiscordVC } from '../discordAudioBot/pdabWrappers.mjs'
|
||||
|
||||
before(async () => {
|
||||
// Any setup needed before tests
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
// Any teardown needed after tests
|
||||
});
|
||||
|
||||
describe('PDAB Wrapper Tests', () => {
|
||||
it('Should open the discord bot, and join the first server when requested', async () => {
|
||||
// Test case
|
||||
const joinData = {
|
||||
channelID: process.env.TEST_CHANNEL_ID,
|
||||
clientID: process.env.TEST_CLIENT_TOKEN,
|
||||
system: process.env.TEST_SYSTEM,
|
||||
};
|
||||
const connection = await joinDiscordVC(joinData);
|
||||
console.log("Connection:", connection);
|
||||
});
|
||||
|
||||
it('Should open OP25', async () => {
|
||||
const res = await chai.request('http://localhost:8081').get('/');
|
||||
expect(res).to.have.status(200); // Assuming 200 is the expected status code
|
||||
// Add more assertions if needed
|
||||
})
|
||||
|
||||
it("Should disconnect from the discord server", async () => {
|
||||
await leaveDiscordVC(process.env.TEST_GUILD_ID);
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user