here my test :
fdescribe('ValueService', () => {
it('#getValue should return real value', () => {
expect(true).toBeTruthy();
});
});
And i have this error :
Failed: Cannot configure the test module when the test module has already been instantiated. Make sure you are not using
inject
beforeR3TestBed.configureTestingModule
. Error: Cannot configure the test module when the test module has already been instantiated. Make sure you are not usinginject
beforeR3TestBed.configureTestingModule
. at TestBedRender3.prototype.assertNotInstantiated (http:/localhost:9876/_karma_webpack_/vendor.js:76150:13) at TestBedRender3.prototype.configureTestingModule (http:/localhost:9876/_karma_webpack_/vendor.js:76045:9) at TestBedRender3.configureTestingModule (http:/localhost:9876/_karma_webpack_/vendor.js:75933:9) at Anonymous function (http:/localhost:9876/_karma_webpack_/main.js:27942:5) at ZoneDelegate.prototype.invoke (http:/localhost:9876/_karma_webpack_/polyfills.js:13991:17) at AsyncTestZoneSpec.prototype.onInvoke (http:/localhost:9876/_karma_webpack_/vendor.js:124156:21) at ProxyZoneSpec.prototype.onInvoke (http:/localhost:9876/_karma_webpack_/vendor.js:125618:17) at ZoneDelegate.prototype.invoke (http:/localhost:9876/_karma_webpack_/polyfills.js:13991:17) at Zone.prototype.runGuarded (http:/localhost:9876/_karma_webpack_/polyfills.js:13761:25) at runInTestZone (http:/localhost:9876/_karma_webpack_/vendor.js:124278:13) NullInjectorError: R3InjectorError(DynamicTestModule)[IRechercheService -> IRechercheService]: NullInjectorError: No provider for IRechercheService! error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'IRechercheService', 'IRechercheService' ] }) at at NullInjector.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:42155:13) at R3Injector.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:52781:13) at R3Injector.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:52781:13) at NgModuleRef$1.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:66043:9) at get (http:/localhost:9876/_karma_webpack_/vendor.js:64279:13) at getOrCreateInjectable (http:/localhost:9876/_karma_webpack_/vendor.js:45064:17) at ɵɵdirectiveInject (http:/localhost:9876/_karma_webpack_/vendor.js:55585:5) at IdentificationRqComponent_Factory (Function code:3:3) at getNodeInjectable (http:/localhost:9876/_karma_webpack_/vendor.js:45172:13) at instantiateRootComponent (http:/localhost:9876/_karma_webpack_/vendor.js:49487:5) Failed: Cannot configure the test module when the test module has already been instantiated. Make sure you are not usinginject
beforeR3TestBed.configureTestingModule
. Error: Cannot configure the test module when the test module has already been instantiated. Make sure you are not usinginject
beforeR3TestBed.configureTestingModule
. at TestBedRender3.prototype.assertNotInstantiated ## Heading ##(http:/localhost:9876/_karma_webpack_/vendor.js:76150:13) at TestBedRender3.prototype.configureTestingModule (http:/localhost:9876/_karma_webpack_/vendor.js:76045:9) at TestBedRender3.configureTestingModule (http:/localhost:9876/_karma_webpack_/vendor.js:75933:9) at Anonymous function (http:/localhost:9876/_karma_webpack_/main.js:95084:5) at ZoneDelegate.prototype.invoke (http:/localhost:9876/_karma_webpack_/polyfills.js:13991:17) at AsyncTestZoneSpec.prototype.onInvoke (http:/localhost:9876/_karma_webpack_/vendor.js:124156:21) at ProxyZoneSpec.prototype.onInvoke (http:/localhost:9876/_karma_webpack_/vendor.js:125618:17) at ZoneDelegate.prototype.invoke (http:/localhost:9876/_karma_webpack_/polyfills.js:13991:17) at Zone.prototype.runGuarded (http:/localhost:9876/_karma_webpack_/polyfills.js:13761:25) at runInTestZone (http:/localhost:9876/_karma_webpack_/vendor.js:124278:13) NullInjectorError: R3InjectorError(DynamicTestModule)[IDroitsObligationsService -> IDroitsObligationsService]: NullInjectorError: No provider for IDroitsObligationsService! error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'IDroitsObligationsService', 'IDroitsObligationsService' ] }) at at NullInjector.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:42155:13) at R3Injector.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:52781:13) at R3Injector.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:52781:13) at NgModuleRef$1.prototype.get (http:/localhost:9876/_karma_webpack_/vendor.js:66043:9) at get (http:/localhost:9876/_karma_webpack_/vendor.js:64279:13) at getOrCreateInjectable (http:/localhost:9876/_karma_webpack_/vendor.js:45064:17) at ɵɵdirectiveInject (http:/localhost:9876/_karma_webpack_/vendor.js:55585:5) at DroitsObligationsComponent_Factory (Function code:3:3) at getNodeInjectable (http:/localhost:9876/_karma_webpack_/vendor.js:45172:13) at instantiateRootComponent (http:/localhost:9876/_karma_webpack_/vendor.js:49487:5)
here my dependencies :
"devDependencies": { "@angular-devkit/build-angular": "~0.803.26", "@angular/cli": "~9.1.6", "@angular/compiler-cli": "~9.1.9", "@angular/language-service": "~9.1.9", "@types/datatables.net-buttons": "~1.4.0", "@types/jasmine": "2.8.3", "@types/jasminewd2": "~2.0.5", "@types/node": "~7.10.11", "@typescript-eslint/eslint-plugin": "~2.34.0", "@typescript-eslint/parser": "~2.34.0", "azure-devops-node-api": "^9.0.1", "codelyzer": "~4.3.0", "config": "~2.0.1", "copyfiles": "^2.1.1", "current-git-branch": "^1.1.0", "eslint": "~7.0.0", "eslint-plugin-react": "~7.20.0", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.2", "karma": "~5.0.9", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-ie-launcher": "~1.0.0", "karma-jasmine": "~3.1.1", "karma-jasmine-html-reporter": "~1.5.4", "karma-junit-reporter": "~2.0.1", "ng-mocks": "~9.3.0", "prompt": "^1.0.0", "protractor": "~7.0.0", "ts-node": "~4.1.0", "typescript": "~3.7.5" }