forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(concatjs): enable junit report for karma_web_test (bazel-contrib…
…#2630) This PR enables junit reports for karma_web_test, by adding karma-junit-reporter as a peer dependency and adding an appropriate configuration that works with bazel. karma-junit-reporter is now a peer dependency of @bazel/concatjs
- Loading branch information
1 parent
a094c00
commit f28cb7d
Showing
17 changed files
with
230 additions
and
0 deletions.
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 |
---|---|---|
|
@@ -4511,6 +4511,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" | ||
|
@@ -7421,6 +7429,11 @@ xml2js@^0.4.17: | |
sax ">=0.6.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) { | ||
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; | ||
} |
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 |
---|---|---|
|
@@ -6222,6 +6222,14 @@ [email protected]: | |
dependencies: | ||
jasmine-core "^3.6.0" | ||
|
||
karma-junit-reporter@^2.0.1: | ||
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" | ||
|
@@ -10453,6 +10461,11 @@ xml2js@^0.4.17: | |
sax ">=0.6.0" | ||
xmlbuilder "~9.0.1" | ||
|
||
[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@~9.0.1: | ||
version "9.0.7" | ||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" | ||
|