<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hands-on Practice on AI VOID</title><link>https://ai-blog.noorshomelab.dev/tags/hands-on-practice/</link><description>Recent content in Hands-on Practice on AI VOID</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 20 Aug 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://ai-blog.noorshomelab.dev/tags/hands-on-practice/index.xml" rel="self" type="application/rss+xml"/><item><title>Writing Tests with Vitest: Hands-on Practice</title><link>https://ai-blog.noorshomelab.dev/angular-v21-mastery/chapter-8-vitest-practical/</link><pubDate>Wed, 20 Aug 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/angular-v21-mastery/chapter-8-vitest-practical/</guid><description>&lt;h2 id="writing-tests-with-vitest-hands-on-practice"&gt;Writing Tests with Vitest: Hands-on Practice&lt;/h2&gt;
&lt;p&gt;In the previous chapter, we introduced Vitest and understood &lt;em&gt;why&lt;/em&gt; it&amp;rsquo;s the new default. Now, let&amp;rsquo;s get our hands dirty and write some actual tests. You&amp;rsquo;ll find that writing tests with Vitest in Angular feels very familiar if you&amp;rsquo;ve used Jasmine/Jest before, as Vitest adopts a similar API.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ll start with a basic component test and then a service test.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prerequisite:&lt;/strong&gt; A new Angular v21 project (e.g., &lt;code&gt;ng new vitest-demo --standalone&lt;/code&gt;) should already be configured with Vitest.&lt;/p&gt;</description></item></channel></rss>