X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Flib%2Ftemplate%2Fia-html.js;h=aabb9ace64c7ab3de414af804c12ed993168edbd;hb=ff66dd49a1b54935a20ea6e15bd036b8acd5e170;hp=8bb1a6c4bd1f6826c99f2f9854000533b480b6b2;hpb=dd173e6b450cbba8100883514610c9fde83d050a;p=squeep-authentication-module diff --git a/test/lib/template/ia-html.js b/test/lib/template/ia-html.js index 8bb1a6c..aabb9ac 100644 --- a/test/lib/template/ia-html.js +++ b/test/lib/template/ia-html.js @@ -1,16 +1,9 @@ /* eslint-env mocha */ 'use strict'; -const assert = require('assert'); +const assert = require('node:assert'); const { IAHTML } = require('../../../lib/template'); -const stubLogger = require('../../stub-logger'); -const lint = require('html-minifier-lint').lint; // eslint-disable-line node/no-unpublished-require - -function lintHtml(html) { - const result = lint(html); - stubLogger.debug('validHtml', '', { result, html }); - assert(!result); -} +const lintHtml = require('../../lint-html'); describe('Template IAHTML', function () { let ctx, options; @@ -26,16 +19,16 @@ describe('Template IAHTML', function () { }; }); - it('renders', function () { + it('renders', async function () { ctx.errors = ['an error', 'another error']; const result = IAHTML(ctx, options); - lintHtml(result); + await lintHtml(result); assert(result); }); - it('covers empty error', function () { + it('covers empty error', async function () { const result = IAHTML(ctx, options); - lintHtml(result); + await lintHtml(result); assert(result); });