Skip to content
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

false positive failure with junit on skipped tests #186

Open
satanTime opened this issue Dec 13, 2020 · 0 comments
Open

false positive failure with junit on skipped tests #186

satanTime opened this issue Dec 13, 2020 · 0 comments

Comments

@satanTime
Copy link

satanTime commented Dec 13, 2020

Hi guys,

I'm facing an issue, when unit tests are skipped, but if I use junit reporter, then the report contains 3 failures which actually aren't failures, because the tests are skipped.

Steps to reproduce:

  1. clone https://github.com/ike18t/ng-mocks (master branch)
  2. execute npm install
  3. execute npm run test -- --reporters junit
  4. check test-reports/specs-junit.xml

Actual behavior:

<testcase name="double-decorator-ivy:without-selector default fails" time="0" classname="double-decorator-ivy:without-selector default">
    <skipped/>
    <failure type="">Error: Directive BaseClass has no selector, please add it!
error properties: Object({ ngSyntaxError: true })
Error: Directive BaseClass has no selector, please add it!
    at syntaxError (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:68525:21)
    at /var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:89275:48
    at &lt;Jasmine&gt;
    at CompileMetadataResolver.getNgModuleMetadata (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:89267:58)
    at CompileMetadataResolver.getNgModuleSummary (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:89139:39)
    at /var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:89226:59
    at &lt;Jasmine&gt;
    at CompileMetadataResolver.getNgModuleMetadata (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:89204:53)
    at JitCompiler._loadModules (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:95375:55)
    at JitCompiler._compileModuleAndAllComponents (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:95363:40)
    at JitCompiler.compileModuleAndAllComponentsAsync (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:95320:41)
    at CompilerImpl.compileModuleAndAllComponentsAsync (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:105517:35)
    at TestingCompilerImpl.compileModuleAndAllComponentsAsync (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:106281:35)
    at TestBedViewEngine.compileComponents (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:102922:35)
    at Function.TestBedViewEngine.compileComponents (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:102783:33)
    at UserContext.&lt;anonymous&gt; (tests/double-decorator/without-selector-ivy.spec.ts:53:10 &lt;- tests/double-decorator/without-selector-ivy.spec.js:113:16)
    at ZoneDelegate.invoke (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:392:30)
    at ProxyZoneSpec.onInvoke (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:4020:43)
    at ZoneDelegate.invoke (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:391:36)
    at Zone.run (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:149:47)
    at runInTestZone (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:3783:38)
    at UserContext.&lt;anonymous&gt; (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:3798:24)
    at &lt;Jasmine&gt;
    at ZoneDelegate.invokeTask (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:427:35)
    at Zone.runTask (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:194:51)
    at drainMicroTaskQueue (/var/folders/d1/z3hb5nb10yx220j2xnhb9qn00000gn/T/karma-typescript-bundle--57785-uqzgASV3c6pX-.js:607:39)
</failure>
</testcase>

Expected behavior:
skipped tests aren't executed with junit reporter

Might you help with that? thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant