@cucumber/html-formatter 11.0.0 → 11.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +15 -0
- package/check.js +22 -0
- package/dist/main.js +164 -2
- package/dist/package.json +5 -4
- package/package.json +5 -4
- package/webpack.config.js +4 -10
- package/dist/main.js.LICENSE.txt +0 -154
package/Makefile
CHANGED
|
@@ -2,11 +2,26 @@ include default.mk
|
|
|
2
2
|
|
|
3
3
|
CCK_NDJSONS = $(shell find ../../compatibility-kit/javascript/features -name "*.ndjson")
|
|
4
4
|
HTML_REPORTS = $(patsubst ../../compatibility-kit/javascript/features/%.ndjson,acceptance/%.html,$(CCK_NDJSONS))
|
|
5
|
+
HTML_REPORT_CHECKS = $(patsubst acceptance/%.html,acceptance/%.html.checked,$(HTML_REPORTS))
|
|
5
6
|
|
|
6
7
|
.built: webpack.config.js
|
|
7
8
|
|
|
9
|
+
ifdef CHECK_INTEGRITY
|
|
10
|
+
# We only check integrity of generated HTML reports when we're making a release.
|
|
11
|
+
# The integrity check only passes when package.json *doesn't* refer to modules
|
|
12
|
+
# using file:..
|
|
13
|
+
#
|
|
14
|
+
# When https://github.com/cucumber/cucumber/issues/1259 is fixed we might
|
|
15
|
+
# be able to check this all the time (including CI)
|
|
16
|
+
.tested: $(HTML_REPORT_CHECKS)
|
|
17
|
+
else
|
|
8
18
|
.tested: $(HTML_REPORTS)
|
|
19
|
+
endif
|
|
9
20
|
|
|
21
|
+
.PRECIOUS: acceptance/%.html
|
|
10
22
|
acceptance/%.html: ../../compatibility-kit/javascript/features/%.ndjson .built
|
|
11
23
|
mkdir -p $(@D)
|
|
12
24
|
cat $< | ./bin/cucumber-html-formatter.js --format ndjson > $@
|
|
25
|
+
|
|
26
|
+
acceptance/%.html.checked: acceptance/%.html
|
|
27
|
+
node check.js $< > $@
|
package/check.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = process.argv[2]
|
|
3
|
+
const html = fs.readFileSync(path, 'utf-8')
|
|
4
|
+
const puppeteer = require('puppeteer');
|
|
5
|
+
|
|
6
|
+
async function check() {
|
|
7
|
+
const browser = await puppeteer.launch();
|
|
8
|
+
const page = await browser.newPage();
|
|
9
|
+
await page.setContent(html)
|
|
10
|
+
const dynamicHTML = await page.evaluate(() => {
|
|
11
|
+
const content = document.querySelector('.cucumber-react')
|
|
12
|
+
return content && content.innerHTML
|
|
13
|
+
});
|
|
14
|
+
await browser.close();
|
|
15
|
+
|
|
16
|
+
if(!dynamicHTML) throw new Error(`The file ${path} did not render a .cucumber-react element. Inspect manually.`)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
check().then(() => console.log(`${path} rendered OK!`)).catch((err) => {
|
|
20
|
+
console.error(err.stack)
|
|
21
|
+
process.exit(1)
|
|
22
|
+
})
|