<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: All You Need to Know About Mocking in Angular Tests (2020)	</title>
	<atom:link href="https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/feed/" rel="self" type="application/rss+xml" />
	<link>https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/</link>
	<description>Advanced Angular Training Made Simple</description>
	<lastBuildDate>Sun, 18 Oct 2020 09:18:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.4</generator>
	<item>
		<title>
		By: The Complete Guide to Angular Testing and a Weird Trick for Faster Unit Tests (2020) – Christian Lüdemann		</title>
		<link>https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-69639</link>

		<dc:creator><![CDATA[The Complete Guide to Angular Testing and a Weird Trick for Faster Unit Tests (2020) – Christian Lüdemann]]></dc:creator>
		<pubDate>Sun, 18 Oct 2020 09:18:20 +0000</pubDate>
		<guid isPermaLink="false">https://christianlydemann.com/?p=794#comment-69639</guid>

					<description><![CDATA[[&#8230;] can get rid of a lot of the boilerplate when writing tests and also get some mock helpers by using Spectator. Spectator wraps the Angular testing methods and provides easy [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] can get rid of a lot of the boilerplate when writing tests and also get some mock helpers by using Spectator. Spectator wraps the Angular testing methods and provides easy [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Richard Danby		</title>
		<link>https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-11296</link>

		<dc:creator><![CDATA[Richard Danby]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 12:24:00 +0000</pubDate>
		<guid isPermaLink="false">https://christianlydemann.com/?p=794#comment-11296</guid>

					<description><![CDATA[Hey Christian, currently deciding on an efficient way to mock services for unit tests myself and I was wondering if the magical mock approach you mentioned is an alternative to creating mock service classes like when creating the mock component classes? I was originally going to create the mock service classes but I am intrigued with this magical mock approach and will give this a try for the moment.]]></description>
			<content:encoded><![CDATA[<p>Hey Christian, currently deciding on an efficient way to mock services for unit tests myself and I was wondering if the magical mock approach you mentioned is an alternative to creating mock service classes like when creating the mock component classes? I was originally going to create the mock service classes but I am intrigued with this magical mock approach and will give this a try for the moment.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Brian Schmitt		</title>
		<link>https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-4191</link>

		<dc:creator><![CDATA[Brian Schmitt]]></dc:creator>
		<pubDate>Fri, 19 Jul 2019 14:50:00 +0000</pubDate>
		<guid isPermaLink="false">https://christianlydemann.com/?p=794#comment-4191</guid>

					<description><![CDATA[Hi Christian,
Your article is helping to point me in the right direction, thanks! However, I am curious about createMagicalMock. You state that &quot;The Angular testing library provides us with a method called createMagicalMock&quot;. I am unable to find that method what module do I need to import? Seems like you have an implementation but in you implementation I don&#039;t know where the Mock class is being imported from. Can you clear this up for me please?]]></description>
			<content:encoded><![CDATA[<p>Hi Christian,<br />
Your article is helping to point me in the right direction, thanks! However, I am curious about createMagicalMock. You state that &#8220;The Angular testing library provides us with a method called createMagicalMock&#8221;. I am unable to find that method what module do I need to import? Seems like you have an implementation but in you implementation I don&#8217;t know where the Mock class is being imported from. Can you clear this up for me please?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Christian Lydemann		</title>
		<link>https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-391</link>

		<dc:creator><![CDATA[Christian Lydemann]]></dc:creator>
		<pubDate>Wed, 24 Apr 2019 06:38:00 +0000</pubDate>
		<guid isPermaLink="false">https://christianlydemann.com/?p=794#comment-391</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-381&quot;&gt;ChenReuven&lt;/a&gt;.

Hey,

1. No problem!

2. You don&#039;t need to change a private field to public just because you use implements. Creating a mock component this way is only needed when you actually need a mock component to do some template testing. By doing implements you get some type safety from the real implementations &lt;b&gt;public&lt;/b&gt; methods. If there is a private field, this would simply not be part of the contract, because only the public properties and methods is part of the contract when using implements. For this reason I don&#039;t see why you would need to change a private method to public. Makes sense?
In most of the cases I would do, as you mentioned, mocking using the automatic mock generator, because I don&#039;t need the component decorator.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-381">ChenReuven</a>.</p>
<p>Hey,</p>
<p>1. No problem!</p>
<p>2. You don&#8217;t need to change a private field to public just because you use implements. Creating a mock component this way is only needed when you actually need a mock component to do some template testing. By doing implements you get some type safety from the real implementations <b>public</b> methods. If there is a private field, this would simply not be part of the contract, because only the public properties and methods is part of the contract when using implements. For this reason I don&#8217;t see why you would need to change a private method to public. Makes sense?<br />
In most of the cases I would do, as you mentioned, mocking using the automatic mock generator, because I don&#8217;t need the component decorator.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ChenReuven		</title>
		<link>https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-381</link>

		<dc:creator><![CDATA[ChenReuven]]></dc:creator>
		<pubDate>Sat, 23 Mar 2019 06:58:00 +0000</pubDate>
		<guid isPermaLink="false">https://christianlydemann.com/?p=794#comment-381</guid>

					<description><![CDATA[Hey,

1. Thanks for sharing
2. Related to mock component via implements like u show. Its bad idea, why?
Cause:
a. U break encupsulation! If u have private field u must chabge it to public, otherwize the tests dosnt work, so u enforce to public the field. This is bad :-(
b. For each change of your regular conponent u MUST add it to the component code, vut u dont really need to mock it, it just a pure boilerplate. This is just for one conponent think abiut the whole enterprise app. (Its crazy :-))

I think dont put any implement dependency just pure object its better solution. (U have also mock lib that create mock automaticly)]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>1. Thanks for sharing<br />
2. Related to mock component via implements like u show. Its bad idea, why?<br />
Cause:<br />
a. U break encupsulation! If u have private field u must chabge it to public, otherwize the tests dosnt work, so u enforce to public the field. This is bad 🙁<br />
b. For each change of your regular conponent u MUST add it to the component code, vut u dont really need to mock it, it just a pure boilerplate. This is just for one conponent think abiut the whole enterprise app. (Its crazy :-))</p>
<p>I think dont put any implement dependency just pure object its better solution. (U have also mock lib that create mock automaticly)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: The Complete Guide to NgRx Testing – Christian Lüdemann IT		</title>
		<link>https://christianlydemann.com/all-you-need-to-know-about-mocking-in-angular-tests/#comment-373</link>

		<dc:creator><![CDATA[The Complete Guide to NgRx Testing – Christian Lüdemann IT]]></dc:creator>
		<pubDate>Sat, 23 Feb 2019 14:57:56 +0000</pubDate>
		<guid isPermaLink="false">https://christianlydemann.com/?p=794#comment-373</guid>

					<description><![CDATA[[&#8230;] the store directly. You can generate a mock automatically using this service mock generator from my All You Need to Know About Mocking in Angular Tests blog post. Again reduced friction = more test coverage and time for fun in life, unless writing [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] the store directly. You can generate a mock automatically using this service mock generator from my All You Need to Know About Mocking in Angular Tests blog post. Again reduced friction = more test coverage and time for fun in life, unless writing [&#8230;]</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 0/1316 objects using Memcache
Page Caching using Disk: Enhanced 
Minified using Disk
Database Caching using Disk (Request-wide modification query)

Served from: christianlydemann.com @ 2026-02-28 05:28:12 by W3 Total Cache
-->