* Helper function to modify the test status of the JSONP report based on the approved file name. * * @param {String} originalJsonpReport - jsonpReport `report(${jsonReport});` * @param {String} approvedFileName - the name of the screenshot that is approved * @return {String} jsonpReport - modifi
(originalJsonpReport, approvedFileName)
| 19 | * @return {String} jsonpReport - modified jsonpReport |
| 20 | */ |
| 21 | function modifyJsonpReportHelper (originalJsonpReport, approvedFileName) { |
| 22 | const report = extractReport(originalJsonpReport); |
| 23 | report.tests.forEach(test => { |
| 24 | if (test.pair.fileName === approvedFileName) { |
| 25 | test.status = 'pass'; |
| 26 | delete test.pair.diffImage; |
| 27 | } |
| 28 | return test; |
| 29 | }); |
| 30 | |
| 31 | const jsonReport = JSON.stringify(report, null, 2); |
| 32 | const jsonpReport = `report(${jsonReport});`; |
| 33 | return jsonpReport; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Modify the test status of the JSONP report based on the approved file name. JSONP is used |
no test coverage detected