Skip to content

Commit 2a4fc33

Browse files
committed
test(meta_generator): tag should be added only once
1 parent cd0d378 commit 2a4fc33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/scripts/filters/meta_generator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ describe('Meta Generator', () => {
1515
});
1616

1717
it('empty <head>', () => {
18-
const content = '<head></head>';
18+
const content = '<head><link rel=""/></head><body><head></head></body>';
1919
const result = metaGenerator(content);
2020

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

2727
it('disable meta_generator', () => {

0 commit comments

Comments
 (0)