diff --git a/test/filter.test.js b/test/filter.test.js index 606ce4a..188c09e 100644 --- a/test/filter.test.js +++ b/test/filter.test.js @@ -44,6 +44,16 @@ describe('html', () => { expect(result).toBe(expected) }) + it('option - logger', () => { + hexo.config.minify.html.logger = true + const path = 'foo' + hexo.log.log = jest.fn() + const input = '

foo

' + h(input, { path }) + expect(hexo.log.log).toHaveBeenCalled() + expect(hexo.log.log).toHaveBeenCalledWith(`html: ${path} [0.00% saved]`) + }) + test('exclude', () => { const exclude = '*.min.html' hexo.config.minify.html.exclude = exclude