In this lecture, we are going to override the authentication service to our fake service.
The process for injecting a fake dependency is similar to injecting a regular dependency to get started.
Open the navigation test file.
In the before each function we're registering a test module.
A service can be registered with a module by adding it to the provider's option.
Let's add this option to the modules configuration object.
Normally we would add the marked off service to the array.
However, that's not going to cut it.
The navigation component injects the authentication service.
The class name must match the name injected by the component.
So how do we replace the original service with our fake service?
Instead of passing in the service, we can add an object with two properties called Provide and use
value.
The Vine option accepts a token.
You can think of a token as an ID during the initialization of our component.
Angular will look at the constructor function's argument list.
The data type of an argument will determine the type of value that will be injected into the components.
This option's value must correspond with the data type.
In this case, the data type was off service.
Let's import this service into our test file.
Next set the provider option to this service.
If Angular finds a match, the value from the used value property will be the injected value.
Let's set this property to the marked off service object.
By passing in this configuration object, we do not need to update our component to use this service.
Angular dependency injection feature allows us to change the value of a dependency.
If a component injects the off service object, the value injected into the component will be the marked
off service object.
Let's move over to the browser to verify this behavior.
As you can see, our test has passed.
Our app is not using the authentication service which uses the angular fire package.
Instead, it'll use the fake dependency.
Unlike the original service, our fake dependency does not rely on Firebase to be functional, thus
allowing our component to be created in the next lecture.
Let's continue working on our test.