Angular · Senior · Question 48 of 75

How do you test guards and routed components together?

Explanation

const harness = await RouterTestingHarness.create(); await harness.navigateByUrl('/admin'); runs real guards and resolvers with provideRouter(routes) in the test.

Further reading

Problem with a question

Angular · Senior · question 48

Test yourself

Take the Angular · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz