Skip to content

Commit

Permalink
test: fix meta_generator test
Browse files Browse the repository at this point in the history
  • Loading branch information
weyusi committed Oct 28, 2018
1 parent 11c85de commit a79da47
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions test/scripts/filters/meta_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,18 @@ describe('Meta Generator', function() {
const cheerio = require('cheerio');

it('default', function() {
let content = `<head><link></head>`;
const content = `<head><link></head>`;
const result = metaGenerator(content);

let data = {
content: content
};

metaGenerator(data);
const $ = cheerio.load(data);
const $ = cheerio.load(result);
$('meta[name="generator"]').length.should.eql(1);
});

it('empty <head>', function() {
let content = `<head></head>`;

let data = {
content: content
};
const content = `<head></head>`;
const result = metaGenerator(content);

metaGenerator(data);
const $ = cheerio.load(data);
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);
Expand Down

0 comments on commit a79da47

Please sign in to comment.