# \[Unit Test\] Error finding provider

**URL:** <https://forum.ionicframework.com/t/unit-test-error-finding-provider/89722>\
**Category:** ionic-v3\
**Created:** [May 10, 2017, 9:56pm UTC](https://forum.ionicframework.com/t/unit-test-error-finding-provider/89722 "2017-05-10T21:56:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kooN7cho](https://avatars.discourse-cdn.com/v4/letter/k/dec6dc/32.png) [@kooN7cho](https://forum.ionicframework.com/u/kooN7cho)\
**Post date:** [May 10, 2017, 9:56pm UTC](https://forum.ionicframework.com/t/unit-test-error-finding-provider/89722/1 "2017-05-10T21:56:04Z")

</div>

Hi guys,

I’m trying to test my code but test shows me this error:

> Error: No provider for W!  
> at injectionError ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:1537:86](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:1537:86))  
> at noProviderError ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:1575:12](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:1575:12))  
> at ReflectiveInjector\_.Array.concat.ReflectiveInjector\_._throwOrNull ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3076:19](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3076:19))  
> at ReflectiveInjector_.Array.concat.ReflectiveInjector\_._getByKeyDefault ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3115:25](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3115:25))  
> at ReflectiveInjector_.Array.concat.ReflectiveInjector\_._getByKey ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3047:25](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3047:25))  
> at ReflectiveInjector_.Array.concat.ReflectiveInjector\_.get ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:2916:21](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:2916:21))  
> at DynamicTestModuleInjector.get (ng:///DynamicTestModule/module.ngfactory.js:156:131)  
> at DynamicTestModuleInjector.getInternal (ng:///DynamicTestModule/module.ngfactory.js:234:61)  
> at DynamicTestModuleInjector.Array.concat.NgModuleInjector.get ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3862:44](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:3862:44))  
> at resolveDep ([http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:11257:45](http://localhost:9876/base/src/test.ts?eee5aa08746e51a55d604253d78d8a13a11752ba:11257:45))

Seems like I’m lacking some dependency but I can’t figure out which one. BTW why is the code not being mapped?

This is my test bed:

```auto

	beforeEach (done => {
		TestBed.configureTestingModule({
			declarations: [AuthenticationComponent],
			imports: [IonicModule, FormsModule],
			providers: [
				App, DomController, AlertController,
				AuthenticationService,
				{provide: GestureController, useClass: GestureControllerStub},
				{provide: Platform, useClass: PlatformStub},
				{provide: Config, useClass: ConfigStub}
			]
		}).compileComponents().then (done).catch (done.fail);
	});

```

Perhaps you are wondering why am I not using `async`, and the answer is: It doesn’t work for me, don’t really know why but using it triggers jasmine.DEFAULT\_TIMEOUT\_INTERVAL which is manually set to 60000.

Hope you guys can help me, I don’t like to ask too much but find out the answers by my self. This way of doing things is making me to lost too much time.
