Skip to content

Commit

Permalink
test: null return handle
Browse files Browse the repository at this point in the history
  • Loading branch information
weyusi committed Oct 28, 2018
1 parent 96595e4 commit 82c4d3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/filter/meta_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function hexoMetaGeneratorInject(data) {

if (!($('meta[name="generator"]').length > 0) && $('head').contents().length > 0) {
$('head').prepend(hexoGeneratorTag.replace('%s', this.version));
}

return $.html();
return $.html();
}
}

module.exports = hexoMetaGeneratorInject;
4 changes: 2 additions & 2 deletions test/scripts/filters/meta_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ describe('Meta Generator', function() {
const content = '<head></head>';
const result = metaGenerator(content);

const $ = cheerio.load(result);
// meta generator should not be prepended if <head> tag is empty
// see https://github.com/hexojs/hexo/pull/3315
$('meta[name="generator"]').length.should.eql(0);
const resultType = typeof result;
resultType.should.eql('undefined');
});
});

0 comments on commit 82c4d3e

Please sign in to comment.