Initial migration to jasmine
- Still bugs in tests from migration
This commit is contained in:
29
spec/test/rssManager.spec.js.b
Normal file
29
spec/test/rssManager.spec.js.b
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user