diff --git a/CHANGELOG.md b/CHANGELOG.md index c1cd5576ea..b0a7da1154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Resolves [#2897](https://github.com/microsoft/BotFramework-WebChat/issues/2897). Moved from JUnit to VSTest reporter with file attachments, by [@compulim](https://github.com/compulim) in PR [#2990](https://github.com/microsoft/BotFramework-WebChat/pull/2990) + ### Changed - Bumped all dependencies to latest versions, by [@compulim](https://github.com/compulim) in PR [#2985](https://github.com/microsoft/BotFramework-WebChat/pull/2985) diff --git a/__tests__/constants.json b/__tests__/constants.json index 3c6f2cc36c..fd54ec6110 100644 --- a/__tests__/constants.json +++ b/__tests__/constants.json @@ -2,7 +2,8 @@ "imageSnapshotOptions": { "customDiffConfig": { "threshold": 0.14 - } + }, + "noColors": true }, "timeouts": { "directLine": 15000, diff --git a/jest.config.js b/jest.config.js index 47786054c3..f6d2f80e25 100644 --- a/jest.config.js +++ b/jest.config.js @@ -29,6 +29,25 @@ module.exports = { .filter(value => value) .join(' › ') } + ], + [ + 'jest-trx-results-processor', + { + outputFile: 'coverage/result.trx', + postProcessTestResult: [ + (testSuiteResult, testResult, testResultNode) => { + testResult.failureMessages.forEach(message => { + const match = /^See diff for details: (.*)/m.exec(message); + + match && + testResultNode + .ele('ResultFiles') + .ele('ResultFile') + .att('path', match[1]); + }); + } + ] + } ] ], setupFilesAfterEnv: ['/__tests__/setup/preSetupTestFramework.js'], diff --git a/package-lock.json b/package-lock.json index 9e9419de24..807a334327 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12225,6 +12225,24 @@ } } }, + "jest-trx-results-processor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jest-trx-results-processor/-/jest-trx-results-processor-2.0.0.tgz", + "integrity": "sha512-rufK7X3C1BR2g9dDLy+cRFoHqRumnKrkhJH5VCWi/7pcAg4950XZWhBNNPVoPQn/D9vVwbdU9g7q7EinoaxUQQ==", + "dev": true, + "requires": { + "uuid": "^3.2.1", + "xmlbuilder": "^14.0.0" + }, + "dependencies": { + "xmlbuilder": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-14.0.0.tgz", + "integrity": "sha512-ts+B2rSe4fIckR6iquDjsKbQFK2NlUk6iG5nf14mDEyldgoc2nEKZ3jZWMPTxGQwVgToSjt6VGIho1H8/fNFTg==", + "dev": true + } + } + }, "jest-util": { "version": "25.1.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-25.1.0.tgz", diff --git a/package.json b/package.json index 376c02847d..f479a35fe4 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "jest": "^25.1.0", "jest-image-snapshot": "^2.12.0", "jest-junit": "^10.0.0", + "jest-trx-results-processor": "^2.0.0", "lerna": "^3.20.2", "lint-staged": "^10.0.8", "lolex": "^5.1.2",