mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
38 lines
1.9 KiB
Markdown
38 lines
1.9 KiB
Markdown
<h1>Router Testing</h1>
|
|
|
|
> Author: Thomas Laforge
|
|
|
|
### Information
|
|
|
|
Testing is a crucial step in building scalable, maintainable, and trustworthy applications.
|
|
Testing should never be avoided, even in the face of short deadlines or strong pressure from the product team.
|
|
Nowadays, there are numerous awesome tools available that make it easy to test your code and provide a great developer experience.
|
|
|
|
In this series of testing exercises, we will learn and master Testing Library that simplifies DOM manipulation for testing any Angular component.
|
|
|
|
### Statement:
|
|
|
|
We have a functional application that lists available books for searching. If the search is valid, you will be directed to one or more books, otherwise, you will end up on an error page.
|
|
|
|
The goal is to test this behavior.
|
|
|
|
A file named `app.component.spec.ts`
|
|
|
|
### Submitting your work
|
|
|
|
1. Fork the project
|
|
2. clone it
|
|
3. npm install
|
|
4. `npx nx serve router-testing` to play with the application
|
|
5. `npx nx test router-testing` to test your application
|
|
6. _...work on it_
|
|
7. Commit your work
|
|
8. Submit a PR with a title beginning with **Answer:17** that I will review and other dev can review.
|
|
|
|
<a href="https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A17+label%3Aanswer"><img src="https://img.shields.io/badge/-Solutions-green" alt="router testing"/></a>
|
|
|
|
<!-- <a href='https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A17+label%3A"answer+author"'><img src="https://img.shields.io/badge/-Author solution-important" alt="router testing solution author"/></a>
|
|
<a href="{Blog post url}" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/-Blog post explanation-blue" alt="router testing blog article"/></a> -->
|
|
|
|
_You can ask any question on_ <a href="https://twitter.com/laforge_toma" target="_blank" rel="noopener noreferrer"><img src="./../../logo/twitter.svg" height=20px alt="twitter"/></a>
|