MCPcopy Create free account
hub / github.com/garris/BackstopJS / modifyJsonpReport

Function modifyJsonpReport

core/util/remote.js:46–56  ·  view source on GitHub ↗

* Modify the test status of the JSONP report based on the approved file name. JSONP is used * to create the Backstop report in browser. This function ensures the UI consistency after * a user apporves a test in browser and refreshes the report without running a test. * * @param {Object} params -

({ reportConfigFilename, approvedFileName })

Source from the content-addressed store, hash-verified

44 * @return {Promise}
45 */
46async function modifyJsonpReport ({ reportConfigFilename, approvedFileName }) {
47 return fs
48 .readFile(reportConfigFilename, 'utf8')
49 .then(content => {
50 const jsonpReport = modifyJsonpReportHelper(content[0], approvedFileName);
51 return fs.writeFile(reportConfigFilename, jsonpReport);
52 })
53 .catch(err => {
54 throw new Error(`Failed to modify the report. ${err.message}.`);
55 });
56}
57
58module.exports = {
59 modifyJsonpReport,

Callers 1

index.jsFile · 0.85

Calls 1

modifyJsonpReportHelperFunction · 0.85

Tested by

no test coverage detected