Files
drb-server/spec/test/rssManager.spec.js.b
Logan Cusano 57aaf04119 Initial migration to jasmine
- Still bugs in tests from migration
2024-05-26 20:41:03 -04:00

30 lines
1.0 KiB
Brainfuck

import * as feedHandler from '../../rss-manager/feedHandler.mjs';
import * as mw from '../../modules/mongo-wrappers/mongoFeedsWrappers.mjs';
import * as drw from '../../discordBot/modules/rssWrappers.mjs';
describe('feedHandler', () => {
it('should call updateFeeds', async () => {
// Spy on the updateFeeds function
const feedsSpy = spyOn(mw, 'getAllFeeds').and.stub();
const sendPostSpy = spyOn(drw, 'sendPost').and.stub();
// Call the function that triggers updateFeeds
// For example:
// someFunctionThatCallsUpdateFeeds();
console.log(await spyOn(feedHandler, 'updateFeeds').and.callThrough({
channels: {
cache: {
get: () => ([{
// Stub methods or properties of the channel object as needed for testing
}])
}
}
}));
// Add your expectations here to ensure updateFeeds was called
expect(feedsSpy).toHaveBeenCalled();
expect(sendPostSpy).toHaveBeenCalled();
// Add more specific expectations if needed
});
});