Skip to content

Commit

Permalink
test: add missing parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Nov 5, 2019
1 parent b2a9d12 commit f7e2532
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ describe('Feed generator', () => {
icon: 'icon.svg'
};

const result = generator(locals);
const feedCfg = hexo.config.feed;
const result = generator(locals, feedCfg.type, feedCfg.path);
const $ = cheerio.load(result.data);

$('feed>icon').text().should.eql(full_url_for.call(hexo, hexo.config.feed.icon));
Expand All @@ -267,7 +268,8 @@ describe('Feed generator', () => {
icon: undefined
};

const result = generator(locals);
const feedCfg = hexo.config.feed;
const result = generator(locals, feedCfg.type, feedCfg.path);
const $ = cheerio.load(result.data);

$('feed>icon').length.should.eql(0);
Expand All @@ -283,7 +285,8 @@ describe('Feed generator', () => {
icon: 'icon.svg'
};

const result = generator(locals);
const feedCfg = hexo.config.feed;
const result = generator(locals, feedCfg.type, feedCfg.path);
const $ = cheerio.load(result.data);

$('rss>channel>image>url').text().should.eql(full_url_for.call(hexo, hexo.config.feed.icon));
Expand All @@ -296,7 +299,8 @@ describe('Feed generator', () => {
icon: undefined
};

const result = generator(locals);
const feedCfg = hexo.config.feed;
const result = generator(locals, feedCfg.type, feedCfg.path);
const $ = cheerio.load(result.data);

$('rss>channel>image').length.should.eql(0);
Expand All @@ -309,10 +313,11 @@ describe('Feed generator', () => {
};
hexo.config = Object.assign(hexo.config, urlConfig);

const rss = generator(locals, hexo.config.feed.type[0]);
const feedCfg = hexo.config.feed;
const rss = generator(locals, feedCfg.type[0], feedCfg.path[0]);
rss.path.should.eql(hexo.config.feed.path[0]);

const atom = generator(locals, hexo.config.feed.type[1]);
const atom = generator(locals, feedCfg.type[1], feedCfg.path[1]);
atom.path.should.eql(hexo.config.feed.path[1]);
});
});
Expand Down

0 comments on commit f7e2532

Please sign in to comment.