<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Luca Ucciero on Medium]]></title>
        <description><![CDATA[Stories by Luca Ucciero on Medium]]></description>
        <link>https://medium.com/@lucaucciero?source=rss-348daa75b89d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9YerbeQXH9ufUDkG.</url>
            <title>Stories by Luca Ucciero on Medium</title>
            <link>https://medium.com/@lucaucciero?source=rss-348daa75b89d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 15:21:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lucaucciero/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stubbing GraphQL in Cypress]]></title>
            <link>https://medium.com/@lucaucciero/stubbing-graphql-in-cypress-421660a6a3ef?source=rss-348daa75b89d------2</link>
            <guid isPermaLink="false">https://medium.com/p/421660a6a3ef</guid>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Luca Ucciero]]></dc:creator>
            <pubDate>Mon, 02 Dec 2019 15:10:28 GMT</pubDate>
            <atom:updated>2019-12-02T15:13:35.803Z</atom:updated>
            <content:encoded><![CDATA[<p>Don’t panic!</p><p>Weeks ago I’ve been assigned on my agile board tasks about the implementation of front-end unit tests in the design system that I and two other brave developer built for our employers.</p><p>The result was really good so I started to work on end to end test for the company websites built with our design system and I chose to use Cypress. Our stack is this: Vue.js &amp; Nuxt.js and Apollo + GraphQL.<br>There was no problem at all once I decided to stub the GraphQL requests.</p><h3>Cypress is really great BUT Cypress doesn’t support fetch!</h3><p>Yep, it’s 2019 but no fetch support yet, they are still working on the issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*qlVemWllEQQOx4Fd_cukBw.gif" /></figure><p>But don’t panic! There is a solution! ✨✨✨</p><p>So down on the code that’s how I implemented the stubbing.</p><pre>Create your test file called <strong>stubMeBro.js</strong></pre><p>Then add the secret recipe, remove fetch!</p><pre>cy.visit(&#39;/&#39;, {</pre><pre>onBeforeLoad(win) {</pre><pre>delete win.fetch;</pre><pre>},</pre><pre>});</pre><p>Stub the response:</p><pre>cy.server();</pre><pre>cy.route(</pre><pre>{</pre><pre>method: &#39;POST&#39;,<em> // Route all POST requests</em></pre><pre>url: &#39;/graphql&#39;,<em> // that have a URL that matches &#39;</em>/graphql<em>&#39;</em></pre><pre>response: &#39;foo&#39; <em>// and force the response to be what you want</em></pre><pre>}</pre><pre>);</pre><p>Then you can go foward.<br>Create a fixture folder and add it to the cypress.json configuration <br>e.g.:</p><pre>{<br>  &quot;fixturesFolder&quot;:&quot;tests/e2e/fixtures&quot;<br>}</pre><p>There you can create a json that mocks the graphQL response</p><p>e.g. <strong>request-info.json</strong>:</p><pre>{</pre><pre>&quot;data&quot;: {</pre><pre>&quot;requestInfo&quot;: {</pre><pre>&quot;statusCode&quot;: 200,</pre><pre>&quot;notice&quot;: {</pre><pre>&quot;type&quot;: &quot;success&quot;,</pre><pre>&quot;text&quot;: &quot;Hello here we go&quot;,</pre><pre>},</pre><pre>&quot;__typename&quot;: &quot;InfoRequestResponse&quot;</pre><pre>}</pre><pre>}</pre><pre>}</pre><p>change <strong>foo</strong> string with the reference to your fixture.</p><pre>response: &#39;fixture:request-info.json&#39;</pre><p>And that’s it!</p><p>🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=421660a6a3ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m a Front-end developer]]></title>
            <link>https://medium.com/@lucaucciero/holy-shit-im-a-front-end-developer-f6ed5db1ce21?source=rss-348daa75b89d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6ed5db1ce21</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[new-job]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Luca Ucciero]]></dc:creator>
            <pubDate>Thu, 26 Apr 2018 19:18:21 GMT</pubDate>
            <atom:updated>2019-03-29T09:10:00.007Z</atom:updated>
            <content:encoded><![CDATA[<p>This month I shut down my previous job at RAI, the Italy’s national public broadcasting company and started a new journey at STUDIO MADO <a href="https://www.studiomado.it/">https://www.studiomado.it/</a>, a really awesome web agency. I followed up my geeky dreams and shifted from a designer/developer job to a mainly developer job, and that was a big change. Front-end is now my main dish.</p><p>Currently I’m learning Vue.js <a href="https://vuejs.org/">https://vuejs.org/</a> and I would like to talk a bit about it.<br>I the last year, as a challenge and to learn how to be a better developer I definitely took what I was always using: Bootstrap &amp; jQuery and I said “So long, and thanks for all the fish”. Dropping them was one of the best thing I ever did because I was able to focus on vanilla JS and React.<br>Fast foward to these days, a new guy moved in my block, and it’s name is Vue.</p><p>I can’t say that was love at first sight, I was looking at him like “what the hell is this? Can i really do things that you usually do with JS, in the markup?!?”</p><p>This is an example of a component of mine, that renders a card that contains an episode information for every episode in the episodes object (that is part of a JSON fetched that contains all this information)</p><pre>&lt;div id=”episode-list”&gt;<br> &lt;episode-card<br> v-for=”episode in episodes”<br> :number=”episode.number”<br> :title=”episode.name”<br> :image=”episode.image.original”<br> :summary=”episode.summary”<br> :season=”episode.season”<br> <a href="http://twitter.com/card">@card</a>-selected=”cardSelection($event)”<br> &gt;<br> &lt;/episode-card&gt;<br> &lt;/div&gt;</pre><p>see this?</p><pre> v-for=”episode in episodes”</pre><p>Well, I was quite skeptic but then in two days, without any prior knowledge of the framework I was able to go from “hello world” to a web app that displays info for all the Rick&amp;Morty episodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*ijCx7ITycinacXJNqyhweA.png" /></figure><p>When you click an episode, a modal gives you the details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*U7HiMiaPZN1VjUrgXj1C4w.png" /></figure><p>And everything in really a small amount of code lines. Now try to do this in jQuery, if you like Spaghetti Code as a meal every day you should!(I’m italian but I don’t like Spaghetti Code). <br>But also I think that is more simple to learn than React.</p><p>I’ll have fun with Vue.js and we’ll see what happens.</p><p>🍝 no more</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6ed5db1ce21" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>