30 lines
1.0 KiB
Brainfuck
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
|
|
});
|
|
});
|