-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(concatjs): enable junit report for karma_web_test #2630
Merged
alexeagle
merged 1 commit into
bazel-contrib:stable
from
kyubisation:feat-concatjs-karma-junit
May 4, 2021
+232
−55
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4298,6 +4298,14 @@ [email protected]: | |
dependencies: | ||
jasmine-core "^3.3" | ||
|
||
[email protected]: | ||
version "2.0.1" | ||
resolved "https://registry.yarnpkg.com/karma-junit-reporter/-/karma-junit-reporter-2.0.1.tgz#d34eef7f0b2fd064e0896954e8851a90cf14c8f3" | ||
integrity sha512-VtcGfE0JE4OE1wn0LK8xxDKaTP7slN8DO3I+4xg6gAi1IoAHAXOJ1V9G/y45Xg6sxdxPOR3THCFtDlAfBo9Afw== | ||
dependencies: | ||
path-is-absolute "^1.0.0" | ||
xmlbuilder "12.0.0" | ||
|
||
[email protected]: | ||
version "1.1.0" | ||
resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" | ||
|
@@ -7350,6 +7358,11 @@ xml2js@^0.4.17: | |
util.promisify "~1.0.0" | ||
xmlbuilder "~11.0.0" | ||
|
||
[email protected]: | ||
version "12.0.0" | ||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-12.0.0.tgz#e2ed675e06834a089ddfb84db96e2c2b03f78c1a" | ||
integrity sha512-lMo8DJ8u6JRWp0/Y4XLa/atVDr75H9litKlb2E5j3V3MesoL50EBgZDWoLT3F/LztVnG67GjPXLZpqcky/UMnQ== | ||
|
||
xmlbuilder@~11.0.0: | ||
version "11.0.1" | ||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1100,6 +1100,14 @@ [email protected]: | |
dependencies: | ||
fun-map "^3.3.1" | ||
|
||
[email protected]: | ||
version "2.0.1" | ||
resolved "https://registry.yarnpkg.com/karma-junit-reporter/-/karma-junit-reporter-2.0.1.tgz#d34eef7f0b2fd064e0896954e8851a90cf14c8f3" | ||
integrity sha512-VtcGfE0JE4OE1wn0LK8xxDKaTP7slN8DO3I+4xg6gAi1IoAHAXOJ1V9G/y45Xg6sxdxPOR3THCFtDlAfBo9Afw== | ||
dependencies: | ||
path-is-absolute "^1.0.0" | ||
xmlbuilder "12.0.0" | ||
|
||
[email protected]: | ||
version "1.1.0" | ||
resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" | ||
|
@@ -2101,6 +2109,11 @@ ws@~3.3.1: | |
safe-buffer "~5.1.0" | ||
ultron "~1.1.0" | ||
|
||
[email protected]: | ||
version "12.0.0" | ||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-12.0.0.tgz#e2ed675e06834a089ddfb84db96e2c2b03f78c1a" | ||
integrity sha512-lMo8DJ8u6JRWp0/Y4XLa/atVDr75H9litKlb2E5j3V3MesoL50EBgZDWoLT3F/LztVnG67GjPXLZpqcky/UMnQ== | ||
|
||
xmlhttprequest-ssl@~1.5.4: | ||
version "1.5.5" | ||
resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function(factory) { | ||
if (typeof module === 'object' && typeof module.exports === 'object') { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} else if (typeof define === 'function' && define.amd) { | ||
define( | ||
'build_bazel_rules_nodejs/packages/concatjs/web_test/test/karma/coverage.spec', | ||
[ | ||
'require', 'exports', | ||
'build_bazel_rules_nodejs/packages/concatjs/web_test/test/karma/coverage_source' | ||
], | ||
factory); | ||
} | ||
})(function(require, exports) { | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', {value: true}); | ||
var coverage_source_1 = | ||
require('build_bazel_rules_nodejs/packages/concatjs/web_test/test/karma/coverage_source'); | ||
describe('coverage function', () => { | ||
it('should cover one branch', () => { | ||
expect(coverage_source_1.isString(2)).toBe(false); | ||
}); | ||
it('should cover the other branch', () => { | ||
expect(coverage_source_1.isString('some string')).toBe(true); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(function(factory) { | ||
alexeagle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (typeof module === 'object' && typeof module.exports === 'object') { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} else if (typeof define === 'function' && define.amd) { | ||
define( | ||
'build_bazel_rules_nodejs/packages/concatjs/web_test/test/karma/coverage_source', | ||
['require', 'exports'], factory); | ||
} | ||
})(function(require, exports) { | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', {value: true}); | ||
function isString(input) { | ||
if (typeof input === 'string') { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
exports.isString = isString; | ||
}); |
20 changes: 20 additions & 0 deletions
20
packages/concatjs/web_test/test/karma/coverage_source_uncovered.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(function(factory) { | ||
if (typeof module === 'object' && typeof module.exports === 'object') { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} else if (typeof define === 'function' && define.amd) { | ||
define( | ||
'build_bazel_rules_nodejs/packages/concatjs/web_test/test/karma/coverage_source_uncovered', | ||
['require', 'exports'], factory); | ||
} | ||
})(function(require, exports) { | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', {value: true}); | ||
// noting in this file should be required, so we can test the c8 feature all: true | ||
// which will pick up files that aren't directly referenced by test files | ||
// but are added to coverage as empty coverage | ||
function notCalled(input) { | ||
return input * 13; | ||
} | ||
exports.notCalled = notCalled; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/concatjs/web_test/test/karma_typescript/coverage.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {isString} from './coverage_source'; | ||
|
||
describe('coverage function', () => { | ||
it('should cover one branch', () => { | ||
expect(isString(2 as any)).toBe(false); | ||
}); | ||
it('should cover the other branch', () => { | ||
expect(isString('some string')).toBe(true); | ||
}); | ||
}); |
7 changes: 7 additions & 0 deletions
7
packages/concatjs/web_test/test/karma_typescript/coverage_source.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function isString(input: string) { | ||
if (typeof input === 'string') { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/concatjs/web_test/test/karma_typescript/coverage_source_uncovered.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// noting in this file should be required, so we can test the c8 feature all: true | ||
// which will pick up files that aren't directly referenced by test files | ||
// but are added to coverage as empty coverage | ||
export function notCalled(input: number) { | ||
return input * 13; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need at least one example that doesn't include this dependency to verify that we didn't accidentally introduce a breaking change.
My preference is to just update one of the examples/ to include the dependency so it's possible to observe the XML output from a karma test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the dependency from angular_view_engine and protocol_buffers and left it in web_testing and angular (since this is the one I'm primarily interested in).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool as long as there's a mix