Who says that testing the Angular router is an icky job? 🙃

A quick intro to navigation and router unit testing in Angular.

Let me be crystal clear.

Photo by Tadeusz Lakota on Unsplash

I want to make sure we get this straight and certain from the get-go.

When I say testing the Angular router I don’t mean that we’re actually writing tests for the Angular router.

Instead, here’s what I’m trying to say.

When I say testing the…


Who else wants to avoid and get rid of those unused Typescript imports that you keep forgetting about? 🤔

A common cause of bloated Angular applications is unneeded imports.

As an application grows, we developers tend to ignore all the dependencies. And we forget to check our imports to make sure we’re not importing things we don’t use.

So how do we avoid this?

How do we make sure…


Who else wants to learn how to properly test an Angular application — in half the time?

Photo by Razvan Chisu on Unsplash

Say!

Why does testing Angular applications have to be so complicated?

Where do you start when you have to write tests for your Angular application?

What are the first steps?

What should you test?

Not sure how to mock a dependency? Or if you should just inject it directly?

And…


So you can shake the bugs outta your Angular code.

Photo by Wynand Uys on Unsplash

Want to skip the read and get to the code right away? Then click here.

Have you ever noticed…

That…

A common dependency inside an Angular service file is the HttpClient? 😸

Maybe your experience with Angular has been different than mine but I find that the HttpClient is a…


Photo by Karol Kasanicky on Unsplash

Every. Single. Time.

How do make sure that your Angular application is always production ready every single time it’s deployed?

What can you do to make sure you never deploy a slow Angular application?

How do use the Lighthouse package with your Angular project to make sure it scores well every single time…


In less than 30 seconds.

Here’s how to configure code coverage to discover which chunks of your Angular application are being tested.

Three.

Two.

One.

GO!

1. Change the angular.json

Open the angular.json file in the root folder of your Angular project.

Scroll to the test section and add the codeCoverage: true line.

Like this.

"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
...
"codeCoverage": true
}
},

Now, when you restart the Angular testing process, you’ll see…


Frustrated with your slow Angular app? Here’s how to double or even triple the speed of your Angular application.

Need to make your Angular app perform faster RIGHT NOW? Then click here to view and download the complete Angular performance checklist.

Otherwise, if you want to dive deep…

…into all the mechanics and logic of how we improve the performance of an Angular application, then read on.

We’ve got…


Using the Mocha reporter to make your Angular tests prettier and more readable. 😄

Some Angular developers grumble about the jumbled output that appears in the terminal when they test their Angular applications.

They want a nicer report that’s easier to understand at a glance….

So…

Karma Mocha Reporter to the rescue!

Once installed and configured, here’s what the outputs will look like.


Here’s the complete guide to setting up a login form and authentication with Angular.

Photo by Markus Spiske on Unsplash

Angular.

Authentication.

And authorization.

How do you do it?

How do you add a login form to your Angular application?

And how do you make sure that users that aren’t logged in automatically see your login page? And the logged-in (authenticated) users see the dashboard or something else?

In this…


Photo by krakenimages on Unsplash

Data models are the backbone of any .NET Core API server.

At least, that’s been my experience.

And building on the data models are the API controllers that give the world access to your data.

Daniel Kreider

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store