Skip to content

Commit

Permalink
Use VSTest (TRX) result and attach diff snapshot files (#2990)
Browse files Browse the repository at this point in the history
* Use TRX result

* Revert

* Add entry

Co-authored-by: Corina <14900841+corinagum@users.noreply.github.com>
  • Loading branch information
compulim and corinagum authored Mar 9, 2020
1 parent 26c1c16 commit 0b0dfe8
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion __tests__/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"imageSnapshotOptions": {
"customDiffConfig": {
"threshold": 0.14
}
},
"noColors": true
},
"timeouts": {
"directLine": 15000,
Expand Down
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: ['<rootDir>/__tests__/setup/preSetupTestFramework.js'],
Expand Down
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0b0dfe8

Please sign in to comment.