get_failed_snapshot_tests.js 512 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. function getFailedSnapshotTests(testResults) {
  6. const failedTestPaths = [];
  7. if (testResults.numFailedTests === 0 || !testResults.testResults) {
  8. return failedTestPaths;
  9. }
  10. testResults.testResults.forEach(testResult => {
  11. if (testResult.snapshot && testResult.snapshot.unmatched) {
  12. failedTestPaths.push(testResult.testFilePath);
  13. }
  14. });
  15. return failedTestPaths;
  16. }
  17. exports.default = getFailedSnapshotTests;