From 8aee8567b4361187154446d72cba8d928ab57b50 Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Mon, 22 Nov 2021 13:54:27 -0500 Subject: [PATCH] Infrastructure: Fix report.js unsupported buffer (#2151) Update test/util/report.js to fix an issue discovered in #959. Buffers being passed to `htmlparser2.parseDocument` is unsupported. --- test/util/report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/util/report.js b/test/util/report.js index ecc497df4b..e8c9215280 100644 --- a/test/util/report.js +++ b/test/util/report.js @@ -108,8 +108,8 @@ const processDocumentationInExampleFiles = function ( exampleCoverage ) { for (let exampleFile of exampleFiles) { - var data = fs.readFileSync(exampleFile); - const dom = htmlparser2.parseDOM(data); + var data = fs.readFileSync(exampleFile, 'utf-8'); + const dom = htmlparser2.parseDocument(data); const $ = cheerio.load(dom); let dataTestIds = new Set();