mirror of https://github.com/curbengh/hexo-yam
test(logger): add test
This commit is contained in:
parent
866593110e
commit
1a5197b9c9
|
@ -44,6 +44,16 @@ describe('html', () => {
|
||||||
expect(result).toBe(expected)
|
expect(result).toBe(expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('option - logger', () => {
|
||||||
|
hexo.config.minify.html.logger = true
|
||||||
|
const path = 'foo'
|
||||||
|
hexo.log.log = jest.fn()
|
||||||
|
const input = '<p>foo</p>'
|
||||||
|
h(input, { path })
|
||||||
|
expect(hexo.log.log).toHaveBeenCalled()
|
||||||
|
expect(hexo.log.log).toHaveBeenCalledWith(`html: ${path} [0.00% saved]`)
|
||||||
|
})
|
||||||
|
|
||||||
test('exclude', () => {
|
test('exclude', () => {
|
||||||
const exclude = '*.min.html'
|
const exclude = '*.min.html'
|
||||||
hexo.config.minify.html.exclude = exclude
|
hexo.config.minify.html.exclude = exclude
|
||||||
|
|
Loading…
Reference in New Issue