Skip to content

Commit

Permalink
refactor(test): specify render engine
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Aug 26, 2020
1 parent 7891c84 commit 9898758
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Empty file removed test/fixtures/foo.styl
Empty file.
6 changes: 3 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ describe('Stylus renderer', () => {
});

describe('nunjucks', () => {
const { join } = require('path');
const hexo = new Hexo(__dirname, { silent: true });
const loremFn = () => { return 'ipsum'; };
const engine = 'styl';

before(async () => {
await hexo.init();
Expand All @@ -191,7 +191,7 @@ describe('Stylus renderer', () => {
});

it('default', async () => {
const result = await hexo.post.render(join(__dirname, 'fixtures', 'foo.styl'), { content: 'foo\n bar: "{% lorem %}"' });
const result = await hexo.post.render(null, { content: 'foo\n bar: "{% lorem %}"', engine });
result.content.should.eql('foo {\n bar: "{% lorem %}";\n}\n');
});

Expand All @@ -200,7 +200,7 @@ describe('Stylus renderer', () => {
renderer.disableNunjucks = false;
hexo.extend.renderer.register('styl', 'css', renderer);

const result = await hexo.post.render(join(__dirname, 'fixtures', 'foo.styl'), { content: 'foo\n bar: "{% lorem %}"' });
const result = await hexo.post.render(null, { content: 'foo\n bar: "{% lorem %}"', engine });
result.content.should.eql('foo {\n bar: "' + loremFn() + '";\n}\n');
});
});
Expand Down

0 comments on commit 9898758

Please sign in to comment.