Skip to content

Commit

Permalink
test: distinguish between update and add
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed May 12, 2024
1 parent 3bc0d73 commit a294344
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ const allureConfig = {
})();
</script>`;
},
labels: {
tag: ({ testCase, value }) => {
if (!isId(testCase.title)) {
return value;
}

const tags = Array.isArray(value) ? value : value ? [value] : [];
const expected = testCase.failureDetails.find((detail) => detail?.matcherResult?.expected);
const actual = testCase.failureDetails.find((detail) => detail?.matcherResult?.actual);
if (expected && actual) {
tags.push('update');
} else if (actual) {
tags.push('addition');
} else if (expected) {
tags.push('deletion');
}

return tags;
},
},
},
testFile: {
ignored: false,
Expand Down

0 comments on commit a294344

Please sign in to comment.