Skip to content

[Bug] multiple error while trying to run unit test #24

Description

@kuldiprindani

Version

1.2.0

Reproduction link

https://jsfiddle.net/

Operating System

win10

Device

PC

Browser & Version

chrome

Steps to reproduce

Just run the unit test.

What is expected?

it should run & complete end successfully

What is actually happening?

typo error resulting in compilation error with name of vector component.

src\app\components\vector-map\vector-map.component.spec.ts

VectorMapComponent instead of VectorMapComponent1

Errors while running unit test.

Chrome 96.0.4664 (Windows 10.0.0): Executed 4 of 17 (3 FAILED) (0 secs / 0.142 secs)
Chrome 96.0.4664 (Windows 10.0.0) AdminLayoutComponent should create FAILED
NullInjectorError: R3InjectorError(DynamicTestModule)[Router -> Router]:
NullInjectorError: No provider for Router!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'Router', 'Router' ] })
at
at NullInjector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10810:1)
at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10977:1)
at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10977:1)
at NgModuleRef$1.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:25033:1)
at Object.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:24747:1)
at lookupTokenUsingModuleInjector (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3296:1)
at getOrCreateInjectable (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3408:1)
at ɵɵdirectiveInject (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14415:1)
at NodeInjectorFactory.AdminLayoutComponent_Factory [as factory] (ng:///AdminLayoutComponent/ɵfac.js:5:48)
at getNodeInjectable (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3503:1)
Error: Expected undefined to be truthy.
at
at UserContext. (http://localhost:9876/_karma_webpack_/src/app/layouts/admin-layout/admin-layout.component.spec.ts:22:23)
at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:365:1)
at ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-testing.js:305:1)
Chrome 96.0.4664 (Windows 10.0.0): Executed 6 of 17 (4 FAILED) (0 secs / 0.171 secs)
Chrome 96.0.4664 (Windows 10.0.0) AdminLayoutComponent should create FAILED
NullInjectorError: R3InjectorError(DynamicTestModule)[Router -> Router]:
NullInjectorError: No provider for Router!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'Router', 'Router' ] })
at
at NullInjector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10810:1)
at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10977:1)
at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10977:1)
at NgModuleRef$1.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:25033:1)
at Object.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:24747:1)
at lookupTokenUsingModuleInjector (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3296:1)
at getOrCreateInjectable (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3408:1)
at ɵɵdirectiveInject (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14415:1)
at NodeInjectorFactory.AdminLayoutComponent_Factory [as factory] (ng:///AdminLayoutComponent/ɵfac.js:5:48)
at getNodeInjectable (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3503:1)
Error: Expected undefined to be truthy.
at
at UserContext. (http://localhost:9876/_karma_webpack_/src/app/layouts/admin-layout/admin-layout.component.spec.ts:22:23)
at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:365:1)
Chrome 96.0.4664 (Windows 10.0.0) NavbarComponent should create FAILED
NullInjectorError: R3InjectorError(DynamicTestModule)[Router -> Router]:
NullInjectorError: No provider for Router!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'Router', 'Router' ] })


Solution

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions