Skip to content

Commit

Permalink
test: improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jun 23, 2020
1 parent 53a4c0c commit 06a2993
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/scripts/filters/external_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,28 @@ describe('External link - post', () => {
].join('\n'));
});

it('deprecated boolean config', () => {
const content = 'foo'
+ '<a href="https://hexo.io/">Hexo</a>'
+ 'bar';

const data = { content };
hexo.config.external_link = false;

try {
externalLink(data);
} catch (err) {
err.name.should.eql('TypeError');
err.message.should.eql('config.external_link no longer supports Boolean value, changelog: https://github.com/hexojs/hexo/releases/');
}

hexo.config.external_link = {
enable: true,
field: 'post',
exclude: ''
};
});

it('exclude - string', () => {
const content = [
'<a href="https://foo.com/">Hexo</a>',
Expand Down

0 comments on commit 06a2993

Please sign in to comment.