Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
23 stars 12 forks source link

Fix the tests of the project `challenge-registry-ui` #365

Closed tschaffter closed 2 years ago

tschaffter commented 2 years ago

How to reproduce:

  1. Work from the main branch.
  2. Clear the local nx cache: nx clear-cache.
  3. Disable Nx Cloud by temporarily renaming the file nx-cloud.env, e.g. to _nx-cloud.env.
  4. Run the test (see below)
$ nx test challenge-registry-ui

> nx run challenge-registry-ui:test

 FAIL   challenge-registry-ui  libs/challenge-registry/ui/src/lib/avatar/avatar.component.spec.ts
  ● AvatarComponent › should create

    Unexpected value 'AvatarModule' imported by the module 'DynamicTestModule'. Please add an @NgModule annotation.

      17 |
      18 |   beforeEach(() => {
    > 19 |     fixture = TestBed.createComponent(AvatarComponent);
         |                       ^
      20 |     component = fixture.componentInstance;
      21 |     fixture.detectChanges();
      22 |   });

      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23845:19)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at Function.get (../../../node_modules/@angular/core/fesm2020/core.mjs:23816:21)
      at R3TestBedCompiler.applyProviderOverridesToModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1066:29)
      at R3TestBedCompiler.compileTestModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1314:14)
      at R3TestBedCompiler.finalize (../../../node_modules/@angular/core/fesm2015/testing.mjs:920:14)
      at TestBedRender3.get testModuleRef [as testModuleRef] (../../../node_modules/@angular/core/fesm2015/testing.mjs:1795:49)
      at TestBedRender3.inject (../../../node_modules/@angular/core/fesm2015/testing.mjs:1718:29)
      at TestBedRender3.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1758:44)
      at Function.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1616:37)
      at src/lib/avatar/avatar.component.spec.ts:19:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

  ● AvatarComponent › should get an Avatar

    Unexpected value 'AvatarModule' imported by the module 'DynamicTestModule'. Please add an @NgModule annotation.

      17 |
      18 |   beforeEach(() => {
    > 19 |     fixture = TestBed.createComponent(AvatarComponent);
         |                       ^
      20 |     component = fixture.componentInstance;
      21 |     fixture.detectChanges();
      22 |   });

      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23845:19)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at Function.get (../../../node_modules/@angular/core/fesm2020/core.mjs:23816:21)
      at R3TestBedCompiler.applyProviderOverridesToModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1066:29)
      at R3TestBedCompiler.compileTestModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1314:14)
      at R3TestBedCompiler.finalize (../../../node_modules/@angular/core/fesm2015/testing.mjs:920:14)
      at TestBedRender3.get testModuleRef [as testModuleRef] (../../../node_modules/@angular/core/fesm2015/testing.mjs:1795:49)
      at TestBedRender3.inject (../../../node_modules/@angular/core/fesm2015/testing.mjs:1718:29)
      at TestBedRender3.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1758:44)
      at Function.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1616:37)
      at src/lib/avatar/avatar.component.spec.ts:19:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/footer/footer.component.spec.ts
 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/button-github/button-github.component.spec.ts
 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/navbar/navbar.component.spec.ts
 FAIL   challenge-registry-ui  libs/challenge-registry/ui/src/lib/org-card/org-card.component.spec.ts
  ● OrgCardComponent › should create

    Importing AvatarModule which does not have a ɵmod property

      12 |
      13 |   beforeEach(async () => {
    > 14 |     await TestBed.configureTestingModule({
         |                   ^
      15 |       declarations: [OrgCardComponent],
      16 |       imports: [
      17 |         HttpClientModule,

      at ../../../node_modules/@angular/core/fesm2020/core.mjs:24090:19
          at Array.forEach (<anonymous>)
      at transitiveScopesFor (../../../node_modules/@angular/core/fesm2020/core.mjs:24087:32)
      at setScopeOnDeclaredComponents (../../../node_modules/@angular/core/fesm2020/core.mjs:24029:30)
      at flushModuleScopingQueueAsMuchAsPossible (../../../node_modules/@angular/core/fesm2020/core.mjs:23715:21)
      at TestBedRender3.checkGlobalCompilationFinished (../../../node_modules/@angular/core/fesm2015/testing.mjs:1821:13)
      at TestBedRender3.configureTestingModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1704:14)
      at Function.configureTestingModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1563:30)
      at src/lib/org-card/org-card.component.spec.ts:14:19
      at ../../../node_modules/tslib/tslib.js:117:75
      at new ZoneAwarePromise (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:1347:33)
      at __awaiter (../../../node_modules/tslib/tslib.js:113:16)
      at src/lib/org-card/org-card.component.spec.ts:13:25
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

  ● OrgCardComponent › orgAvatar name and avatar should be defined

    Unexpected value 'AvatarModule' imported by the module 'AvatarModule'. Please add an @NgModule annotation.

      24 |
      25 |   beforeEach(() => {
    > 26 |     fixture = TestBed.createComponent(OrgCardComponent);
         |                       ^
      27 |     component = fixture.componentInstance;
      28 |     component.org = MOCK_ORG;
      29 |   });

      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23845:19)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at Function.get (../../../node_modules/@angular/core/fesm2020/core.mjs:23816:21)
      at R3TestBedCompiler.applyProviderOverridesToModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1066:29)
      at R3TestBedCompiler.compileTestModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1314:14)
      at R3TestBedCompiler.finalize (../../../node_modules/@angular/core/fesm2015/testing.mjs:920:14)
      at TestBedRender3.get testModuleRef [as testModuleRef] (../../../node_modules/@angular/core/fesm2015/testing.mjs:1795:49)
      at TestBedRender3.inject (../../../node_modules/@angular/core/fesm2015/testing.mjs:1718:29)
      at TestBedRender3.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1758:44)
      at Function.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1616:37)
      at src/lib/org-card/org-card.component.spec.ts:26:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

  ● OrgCardComponent › src property of orgAvatar should be empty string

    Unexpected value 'AvatarModule' imported by the module 'AvatarModule'. Please add an @NgModule annotation.

      24 |
      25 |   beforeEach(() => {
    > 26 |     fixture = TestBed.createComponent(OrgCardComponent);
         |                       ^
      27 |     component = fixture.componentInstance;
      28 |     component.org = MOCK_ORG;
      29 |   });

      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23845:19)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at Function.get (../../../node_modules/@angular/core/fesm2020/core.mjs:23816:21)
      at R3TestBedCompiler.applyProviderOverridesToModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1066:29)
      at R3TestBedCompiler.compileTestModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1314:14)
      at R3TestBedCompiler.finalize (../../../node_modules/@angular/core/fesm2015/testing.mjs:920:14)
      at TestBedRender3.get testModuleRef [as testModuleRef] (../../../node_modules/@angular/core/fesm2015/testing.mjs:1795:49)
      at TestBedRender3.inject (../../../node_modules/@angular/core/fesm2015/testing.mjs:1718:29)
      at TestBedRender3.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1758:44)
      at Function.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1616:37)
      at src/lib/org-card/org-card.component.spec.ts:26:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

  ● OrgCardComponent › login property of org should be used for orgAvatar name

    Unexpected value 'AvatarModule' imported by the module 'AvatarModule'. Please add an @NgModule annotation.

      24 |
      25 |   beforeEach(() => {
    > 26 |     fixture = TestBed.createComponent(OrgCardComponent);
         |                       ^
      27 |     component = fixture.componentInstance;
      28 |     component.org = MOCK_ORG;
      29 |   });

      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23845:19)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at Function.get (../../../node_modules/@angular/core/fesm2020/core.mjs:23816:21)
      at R3TestBedCompiler.applyProviderOverridesToModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1066:29)
      at R3TestBedCompiler.compileTestModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1314:14)
      at R3TestBedCompiler.finalize (../../../node_modules/@angular/core/fesm2015/testing.mjs:920:14)
      at TestBedRender3.get testModuleRef [as testModuleRef] (../../../node_modules/@angular/core/fesm2015/testing.mjs:1795:49)
      at TestBedRender3.inject (../../../node_modules/@angular/core/fesm2015/testing.mjs:1718:29)
      at TestBedRender3.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1758:44)
      at Function.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1616:37)
      at src/lib/org-card/org-card.component.spec.ts:26:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

 FAIL   challenge-registry-ui  libs/challenge-registry/ui/src/lib/user-button/user-button.component.spec.ts
  ● UserButtonComponent › should create

    Importing AvatarModule which does not have a ɵmod property

      14 |
      15 |   beforeEach(async () => {
    > 16 |     await TestBed.configureTestingModule({
         |                   ^
      17 |       declarations: [UserButtonComponent],
      18 |       imports: [
      19 |         HttpClientModule,

      at ../../../node_modules/@angular/core/fesm2020/core.mjs:24090:19
          at Array.forEach (<anonymous>)
      at transitiveScopesFor (../../../node_modules/@angular/core/fesm2020/core.mjs:24087:32)
      at setScopeOnDeclaredComponents (../../../node_modules/@angular/core/fesm2020/core.mjs:24029:30)
      at flushModuleScopingQueueAsMuchAsPossible (../../../node_modules/@angular/core/fesm2020/core.mjs:23715:21)
      at TestBedRender3.checkGlobalCompilationFinished (../../../node_modules/@angular/core/fesm2015/testing.mjs:1821:13)
      at TestBedRender3.configureTestingModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1704:14)
      at Function.configureTestingModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1563:30)
      at src/lib/user-button/user-button.component.spec.ts:16:19
      at ../../../node_modules/tslib/tslib.js:117:75
      at new ZoneAwarePromise (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:1347:33)
      at __awaiter (../../../node_modules/tslib/tslib.js:113:16)
      at src/lib/user-button/user-button.component.spec.ts:15:25
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

  ● UserButtonComponent › should emit

    Unexpected value 'AvatarModule' imported by the module 'AvatarModule'. Please add an @NgModule annotation.

      27 |
      28 |   beforeEach(() => {
    > 29 |     fixture = TestBed.createComponent(UserButtonComponent);
         |                       ^
      30 |     component = fixture.componentInstance;
      31 |     fixture.detectChanges();
      32 |   });

      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23845:19)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at ../../../node_modules/@angular/core/fesm2020/core.mjs:23856:9
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../../../node_modules/@angular/core/fesm2020/core.mjs:23854:60)
      at Function.get (../../../node_modules/@angular/core/fesm2020/core.mjs:23816:21)
      at R3TestBedCompiler.applyProviderOverridesToModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1066:29)
      at R3TestBedCompiler.compileTestModule (../../../node_modules/@angular/core/fesm2015/testing.mjs:1314:14)
      at R3TestBedCompiler.finalize (../../../node_modules/@angular/core/fesm2015/testing.mjs:920:14)
      at TestBedRender3.get testModuleRef [as testModuleRef] (../../../node_modules/@angular/core/fesm2015/testing.mjs:1795:49)
      at TestBedRender3.inject (../../../node_modules/@angular/core/fesm2015/testing.mjs:1718:29)
      at TestBedRender3.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1758:44)
      at Function.createComponent (../../../node_modules/@angular/core/fesm2015/testing.mjs:1616:37)
      at src/lib/user-button/user-button.component.spec.ts:29:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
      at Zone.Object.<anonymous>.Zone.run (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
      at Object.wrappedFunc (../../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)

-------------------------------|---------|----------|---------|---------|-------------------
File                           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------------------|---------|----------|---------|---------|-------------------
All files                      |   80.28 |        0 |   42.85 |   75.43 |                   
 avatar                        |   63.63 |        0 |       0 |   55.55 |                   
  avatar.component.html        |     100 |      100 |     100 |     100 |                   
  avatar.component.ts          |   33.33 |        0 |       0 |      20 | 10-23             
  avatar.module.ts             |     100 |      100 |     100 |     100 |                   
  mock-avatars.ts              |     100 |      100 |     100 |     100 |                   
 button-github                 |     100 |      100 |     100 |     100 |                   
  button-github.component.html |     100 |      100 |     100 |     100 |                   
  button-github.component.ts   |     100 |      100 |     100 |     100 |                   
 footer                        |     100 |      100 |     100 |     100 |                   
  footer.component.html        |     100 |      100 |     100 |     100 |                   
  footer.component.ts          |     100 |      100 |     100 |     100 |                   
 navbar                        |     100 |      100 |     100 |     100 |                   
  navbar.component.html        |     100 |      100 |     100 |     100 |                   
  navbar.component.ts          |     100 |      100 |     100 |     100 |                   
 org-card                      |      75 |        0 |       0 |   66.66 |                   
  mock-org.ts                  |     100 |      100 |     100 |     100 |                   
  org-card.component.html      |     100 |      100 |     100 |     100 |                   
  org-card.component.ts        |   66.66 |        0 |       0 |      50 | 15-16             
 user-button                   |   63.63 |      100 |       0 |   55.55 |                   
  mock-menu-items.ts           |     100 |      100 |     100 |     100 |                   
  user-button.component.html   |     100 |      100 |     100 |     100 |                   
  user-button.component.ts     |   55.55 |      100 |       0 |   42.85 | 12-17             
-------------------------------|---------|----------|---------|---------|-------------------
Test Suites: 3 failed, 3 passed, 6 total
Tests:       8 failed, 5 passed, 13 total
Snapshots:   0 total
Time:        3.47 s
Ran all test suites.

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Ran target test for project challenge-registry-ui (4s)

    ✖    1/1 failed
    ✔    0/1 succeeded [0 read from cache]

   See Nx Cloud run details at https://nx.app/runs/e2Z3TYlK0x0
tschaffter commented 2 years ago

@rrchai I'm changing the priority of this ticket to Low. Solving this issue will probably also solve #364 .

rrchai commented 2 years ago

@tschaffter I was not able to reproduce the error following below steps:

  1. Update and work from the main branch.
  2. Clear the local nx cache: nx clear-cache.
  3. Disable Nx Cloud by temporarily renaming the file nx-cloud.env, e.g. to _nx-cloud.env.
  4. Rename all testing files in ui library, *_spec.ts.off to *_spec.ts
  5. Run the test: nx test challenge-registry-ui
Screen Shot 2022-06-29 at 10 38 51 AM

I did need to rebuild the devcontainer after syncing up with upstream/main.

tschaffter commented 2 years ago

BTW I learned recently that we can use the shortcut nx reset instead of nx clear-cache to clear the local cache.

I'm trying to run the tests on my MBP but it's super slow. Could you try again but first run challenge-install when working from the main branch? I think that the issue arose after I updated a package in package.json.

tschaffter commented 2 years ago

I also found a better why to disable the cache for a given command instead of clearing the local cache and renaming nx-cloud.env: simply appends --skip-nx-cache to the nx command.

rrchai commented 2 years ago

Thanks for the tips. I am still not able to reproduce the error.

vscode@71ac81592925:/workspaces/challenge-registry$ challenge-install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > keycloak-angular@9.1.0" has incorrect peer dependency "keycloak-js@^10 || ^11 || ^12 || ^13 || ^14 || ^15 || ^16".
warning " > ngx-avatar@4.1.0" has incorrect peer dependency "@angular/common@^11.1.0".
warning " > ngx-avatar@4.1.0" has incorrect peer dependency "@angular/core@^11.1.0".
warning "@nrwl/angular > jasmine-marbles@0.8.4" has incorrect peer dependency "rxjs@^6.5.3".
warning "@nrwl/angular > rxjs-for-await@0.0.2" has incorrect peer dependency "rxjs@^6.0.0".
warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "@babel/core@^7.0.1".
warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "@babel/preset-env@^7.0.0".
warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "babel-loader@^8.0.2".
warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "webpack@^4 || ^5".
warning "babel-jest > babel-preset-jest@27.5.1" has unmet peer dependency "@babel/core@^7.0.0".
warning "redoc > style-loader@3.3.1" has unmet peer dependency "webpack@^5.0.0".
warning "@nrwl/react > @nrwl/web > rollup-plugin-typescript2 > @yarn-tool/resolve-package > @ts-type/package-dts@1.0.58" has unmet peer dependency "@types/bluebird@*".
warning "@nrwl/react > @nrwl/web > rollup-plugin-typescript2 > @yarn-tool/resolve-package > @ts-type/package-dts@1.0.58" has unmet peer dependency "ts-toolbelt@*".
warning "@nrwl/react > @nrwl/web > rollup-plugin-typescript2 > @yarn-tool/resolve-package > @ts-type/package-dts > ts-type@2.1.4" has unmet peer dependency "@types/bluebird@*".
warning "@nrwl/react > @nrwl/web > rollup-plugin-typescript2 > @yarn-tool/resolve-package > @ts-type/package-dts > ts-type@2.1.4" has unmet peer dependency "ts-toolbelt@^9.6.0".
warning " > @nx-tools/nx-docker@2.3.0" has unmet peer dependency "dotenv@^10.0.0".
warning "@nx-tools/nx-docker > @nx-tools/core@2.3.1" has unmet peer dependency "@nrwl/devkit@^12.0.0 || ^13.0.0".
warning "@nx-tools/nx-docker > @nx-tools/docker-metadata@2.2.1" has unmet peer dependency "@nrwl/devkit@^12.0.0 || ^13.0.0".
warning " > @nxrocks/nx-spring-boot@4.1.0" has unmet peer dependency "@nxrocks/common@0.0.0-development".
warning " > @nxrocks/nx-spring-boot@4.1.0" has unmet peer dependency "xmlbuilder2@^3.0.2".
warning " > @nxrocks/nx-spring-boot@4.1.0" has unmet peer dependency "unzipper@^0.10.11".
warning " > @nxrocks/nx-spring-boot@4.1.0" has unmet peer dependency "xpath@^0.0.32".
warning "@nxrocks/nx-spring-boot > @nrwl/devkit@14.1.7" has unmet peer dependency "nx@>= 13.10 <= 15".
warning " > babel-jest@27.2.3" has unmet peer dependency "@babel/core@^7.8.0".
warning " > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint@^7.12.1".
warning " > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint-plugin-promise@^4.2.1 || ^5.0.0".
warning " > redoc@2.0.0-rc.63" has unmet peer dependency "mobx@^6.0.4".
warning " > redoc@2.0.0-rc.63" has unmet peer dependency "styled-components@^4.1.1 || ^5.1.1".
warning "redoc > @redocly/react-dropdown-aria@2.0.12" has unmet peer dependency "styled-components@^5.1.1".
warning "redoc > mobx-react@7.2.1" has unmet peer dependency "mobx@^6.1.0".
warning "redoc > mobx-react > mobx-react-lite@3.2.3" has unmet peer dependency "mobx@^6.1.0".
warning "redoc-cli > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
$ ngcc --properties es2015 browser module main
Processing legacy "View Engine" libraries:
- @angular-architects/module-federation-runtime [es2015/esm2015] ()
- ngx-avatar [es2015/esm2015] (https://github.com/HaithemMosbahi/ngx-avatar)
- @angular-architects/module-federation-runtime [main/umd] ()
- ngx-avatar [main/umd] (https://github.com/HaithemMosbahi/ngx-avatar)
Encourage the library authors to publish an Ivy distribution.
$ husky install
husky - Git hooks installed
Done in 239.49s.

vscode@71ac81592925:/workspaces/challenge-registry$ nx reset

 >  NX   Resetting the Nx workspace cache and stopping the Nx Daemon.

   This might take a few minutes.

 >  NX   Daemon Server - Stopped

>  NX   Successfully reset the Nx workspace.

vscode@71ac81592925:/workspaces/challenge-registry$ nx test challenge-registry-ui --skip-nx-cache

> nx run challenge-registry-ui:test

 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/button-github/button-github.component.spec.ts
 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/footer/footer.component.spec.ts
 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/avatar/avatar.component.spec.ts
 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/navbar/navbar.component.spec.ts
 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/org-card/org-card.component.spec.ts
 PASS   challenge-registry-ui  libs/challenge-registry/ui/src/lib/user-button/user-button.component.spec.ts
-------------------------------|---------|----------|---------|---------|-------------------
File                           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------------------|---------|----------|---------|---------|-------------------
All files                      |     100 |      100 |     100 |     100 |                   
 avatar                        |     100 |      100 |     100 |     100 |                   
  avatar.component.html        |     100 |      100 |     100 |     100 |                   
  avatar.component.ts          |     100 |      100 |     100 |     100 |                   
  avatar.module.ts             |     100 |      100 |     100 |     100 |                   
  mock-avatars.ts              |     100 |      100 |     100 |     100 |                   
 button-github                 |     100 |      100 |     100 |     100 |                   
  button-github.component.html |     100 |      100 |     100 |     100 |                   
  button-github.component.ts   |     100 |      100 |     100 |     100 |                   
 footer                        |     100 |      100 |     100 |     100 |                   
  footer.component.html        |     100 |      100 |     100 |     100 |                   
  footer.component.ts          |     100 |      100 |     100 |     100 |                   
 navbar                        |     100 |      100 |     100 |     100 |                   
  navbar.component.html        |     100 |      100 |     100 |     100 |                   
  navbar.component.ts          |     100 |      100 |     100 |     100 |                   
 org-card                      |     100 |      100 |     100 |     100 |                   
  mock-org.ts                  |     100 |      100 |     100 |     100 |                   
  org-card.component.html      |     100 |      100 |     100 |     100 |                   
  org-card.component.ts        |     100 |      100 |     100 |     100 |                   
 user-button                   |     100 |      100 |     100 |     100 |                   
  mock-menu-items.ts           |     100 |      100 |     100 |     100 |                   
  user-button.component.html   |     100 |      100 |     100 |     100 |                   
  user-button.component.ts     |     100 |      100 |     100 |     100 |                   
-------------------------------|---------|----------|---------|---------|-------------------

Test Suites: 6 passed, 6 total
Tests:       13 passed, 13 total
Snapshots:   0 total
Time:        7.963 s
Ran all test suites.

 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Successfully ran target test for project challenge-registry-ui (9s)