Skip to content

Commit

Permalink
test: remove duplicate operation (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Sep 2, 2020
1 parent e4bbcda commit 001d9d4
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,25 +321,14 @@ describe('Marked renderer', () => {
});

describe('sanitizeUrl option tests', () => {
const hexo = new Hexo(__dirname, {silent: true});
const ctx = Object.assign(hexo, {
config: {
marked: {
sanitizeUrl: true
}
}
});

const renderer = require('../lib/renderer');

const body = [
'[script](javascript:foo)',
'',
'[Hexo](http://hexo.io)'
].join('\n');

it('sanitizeUrl enabled', () => {
const r = renderer.bind(ctx);
hexo.config.marked.sanitizeUrl = true;
const result = r({text: body});

result.should.eql([
Expand All @@ -349,8 +338,7 @@ describe('Marked renderer', () => {
});

it('sanitizeUrl disabled', () => {
ctx.config.marked.sanitizeUrl = false;
const r = renderer.bind(ctx);
hexo.config.marked.sanitizeUrl = false;
const result = r({text: body});

result.should.eql([
Expand Down

0 comments on commit 001d9d4

Please sign in to comment.