mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
fix(updater): dispatch setFeedURL by provider instead of raw url
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { resolveFeedUrl, FEEDS } = require('../../../../src/main/updater/feed-config');
|
||||
const { resolveFeedUrl, feedConfigFor, FEEDS } = require('../../../../src/main/updater/feed-config');
|
||||
|
||||
describe('feed-config', () => {
|
||||
test('resolves github channel to GitHub Releases feed', () => {
|
||||
@@ -30,4 +30,20 @@ describe('feed-config', () => {
|
||||
expect(FEEDS.github).toBeDefined();
|
||||
expect(FEEDS.concreteinfo).toBeDefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('feedConfigFor', () => {
|
||||
test('returns github provider config for github channel', () => {
|
||||
const config = feedConfigFor('github');
|
||||
expect(config).toEqual({ provider: 'github', owner: 'amitwh', repo: 'markdown-converter' });
|
||||
});
|
||||
|
||||
test('returns generic provider config for concreteinfo channel', () => {
|
||||
const config = feedConfigFor('concreteinfo');
|
||||
expect(config).toEqual({ provider: 'generic', url: 'https://updates.concreteinfo.co.in/v5' });
|
||||
});
|
||||
|
||||
test('falls back to generic provider on unknown channel', () => {
|
||||
const config = feedConfigFor('something-weird');
|
||||
expect(config).toEqual({ provider: 'generic', url: 'https://updates.concreteinfo.co.in/v5' });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user