<?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 Marco Vanali on Medium]]></title>
        <description><![CDATA[Stories by Marco Vanali on Medium]]></description>
        <link>https://medium.com/@marcovanali?source=rss-aa7353e57c9b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lbn0S_7FfFLs9BmNRQyyRQ.jpeg</url>
            <title>Stories by Marco Vanali on Medium</title>
            <link>https://medium.com/@marcovanali?source=rss-aa7353e57c9b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:22:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcovanali/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[Create Jira tickets with ChatGPT and JiraAPI]]></title>
            <link>https://marcovanali.medium.com/create-jira-tickets-with-chatgpt-and-jiraapi-2fed2123b67a?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fed2123b67a</guid>
            <category><![CDATA[jira]]></category>
            <category><![CDATA[tickets]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Fri, 27 Jan 2023 11:07:39 GMT</pubDate>
            <atom:updated>2023-01-29T11:39:53.020Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*lJXig9z_Uo-iGfDzMDZhvA.png" /></figure><h4>Introduction</h4><p>(Go to “<em>First thing first” </em>section<em> </em>for the start of the project)</p><p>I am a lover of emerging technologies, and I always feel a sense of excitement and wonder when thinking about the potential they may have and what cool things that can be created with them.</p><p><em>My latest love was Spark AR, and you can see a cool filter I made, which enhanced the book cover of The Little Prince </em><a href="https://www.linkedin.com/feed/update/urn:li:activity:6690911621293858816/"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*qoaGlCj7x__OGLLM" /></figure><p>But recently, I discovered ChatGPT.<br>I was truly amazed by its capabilities. Not only does it possess an immense amount of knowledge on a variety of topics, but it also presents this information in a way that is easy for me to understand. <br><em>I can only imagine how useful this tool would have been during my high school math classes, I still have dreams about exams.</em></p><p>With this newfound love for ChatGPT, I decided to put it to the test by asking for its help with some of my daily and weekly tasks, such as coding questions and experimenting with creating Jira tickets. To my surprise, ChatGPT was able to provide me with insightful answers and even gave me a great example of a Jira ticket.</p><p>As always on the look for some fun side project I thought, what if I could use ChatGPT to create a simple web app that generates Jira tickets by simply providing a title? And so, I started experimenting with this concept.</p><p>The main goal for me was to have fun with the ChatGPT API, understand how it works, and try to build something on top of it. And it happened.</p><h4>First thing first</h4><p>I needed a few things</p><ul><li>Create an App with frontend and server</li><li>Set up ChatGPT for making API Calls and read about how to interact with ChatGPT through the API</li><li>Figure out how to create a Jira ticket through their API, if even possible.</li></ul><p>Before adventuring to do everything myself I had a look at the <a href="https://github.com/openai/">OpenAi GitHub repo</a>. And I have found exactly what I was looking for; a “<a href="https://github.com/openai/openai-quickstart-node">quick start node app</a>”. Built-in React and Nextjs, are perfect for me, exactly my cup of tea.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*dswmwozkOSbNCz9Z" /></figure><h4>Action</h4><p>I cloned it and had a good look at the application.</p><p>How ChatGPT was being set up was fairly simple I just had to get my OpenAI key, add it and I could immediately do the calls by using the <a href="https://beta.openai.com/docs/api-reference/completions/create">createCompletion</a> function. Which did fit my needs for creating Jira ticket texts.</p><pre>const configuration = new Configuration({<br>  apiKey: process.env.OPENAI_API_KEY,<br>});<br>const openai = new OpenAIApi(configuration);</pre><p>After playing around with some of the parameters and reading the OpenAI documentation I finally did get a satisfying basic ticket text for a React component Jira ticket, I could pass any title and have the ticket content and title rendered on my page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*7JDHABLiyp3mdKw8B0DQEg.png" /></figure><p>Clicking “Generate ticket text” a call to OpenAi gets done; the result is received and rendered on the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*lNFqVyD0FzIl-TW1KX0rlA.png" /></figure><p>I asked to create a ticket titled “ Create a Card component for NewsKit Design System”, <em>the team I am working for at the moment</em>.</p><p>I tested it a few times and this is one of the outputs:</p><blockquote>Title: Create Card Component for Newskit Design System</blockquote><blockquote>Description:<br>The goal of this ticket is to create a Card component for the Newskit design system. The Card component should be a ReactJS component, composed by semantic HTML tags following WCAG 2.0 guidelines. The Card component should be customisable through props, and should be designed following the Newskit design system.</blockquote><blockquote>Requirements:<br>The Card component should accept the following props:<br>- data (Type: Object): This prop should contain all the data that the card will display.<br>- size (Type: String): This prop should determine the size of the card. The possible values are ‘small’, ‘medium’ and ‘large’.<br>- onClick (Type: Function): This prop should determine what happens when the card is clicked.</blockquote><blockquote>The Card component should be composed by the following HTML tags:<br>- div (HTML attributes: className): The className attribute should be used to assign a class to the div, so that it can be styled with CSS.<br>- h3 (HTML attributes: className, id): The className attribute should be used to assign a class to the h3, so that it can be styled with CSS. The id attribute should be used to assign a unique id to the h3, so that it can be targeted with CSS.<br>- img (HTML attributes: className, alt): The className attribute should be used to assign a class to the img, so that it can be styled with CSS. The alt attribute should be used to provide a descriptive text for the image, for accessibility purposes.<br>- p (HTML attributes: className): The className attribute should be used to assign a class to the p, so that it can be styled with CSS.</blockquote><blockquote>Accessibility:<br>The Card component should be designed following the WCAG 2.0 guidelines, and should be tested using an automated accessibility testing tool.</blockquote><blockquote>SEO:<br>The Card component should be designed following SEO best practices and should be tested using an automated SEO testing tool.</blockquote><blockquote>HTML Example:<br>&lt;div class=”card”&gt;<br> &lt;h3 class=”card-title” id=”card-title”&gt;Card Title&lt;/h3&gt;<br> &lt;img class=”card-image” src=”image.jpg” alt=”Image of a cat” /&gt;<br> &lt;p class=”card-description”&gt;Description of the card.&lt;/p&gt;<br>&lt;/div&gt;</blockquote><blockquote>Design:<br>The Card component should follow the design of the Newskit design system.</blockquote><blockquote>Acceptance Criteria:<br>- The Card component should be created as a ReactJS component.<br>- The Card component should be composed by semantic HTML tags following WCAG 2.0 guidelines.<br>- The Card component should be customisable through props.<br>- The Card component should be designed following the Newskit design system.<br>- The Card component should be tested using an automated accessibility testing tool.<br>- The Card component should be tested using an automated SEO testing tool.</blockquote><blockquote>Supporting Information:<br>N/A</blockquote><blockquote>Dependencies:<br><strong>N/A</strong></blockquote><p>A total of 439 words and 2711 characters. Impressive!</p><p>As you can see a simple title gave me lots of information! In order to achieve this, from a short title, I automatically complete the input I have written with extra requests; for example: the accessibility section, React props, a semantic HTML structure, and so on. Also, through the API call, I ask OpenAI to use a “higher” amount of “tokens” to get a longer and better result, ideally.</p><p>Now, as quickly as I got my ticket content I want to create it on Jira to be a real ticket!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*ckoHQw5ltgvs_Aaq" /></figure><p>I asked ChatGPT to provide me with a function to create a Jira ticket using the Jira API. They provided me with a helpful function I used as a base, however, it required some adjustments before it could be used. To be honest, this was the most challenging part of the process so far. I had to read the Jira API documentation and troubleshoot multiple 405 and 400 errors. After resolving my authentication credentials and creating a properly formatted request body, I was finally able to create the ticket successfully. The request returned a status of 201 and my Jira ticket was added to the backlog!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*-1RsYCI5dfujeBVGcsrWGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*mijAKqCGenWIQN7b2uneYQ.png" /></figure><h4>Thoughts</h4><p>For companies where tickets creation is a daily task which does take time, it is definitely something to explore or consider.</p><p>Through this approach, you can <strong>create JIRA tickets</strong> <strong>quickly</strong>, and for someone with no technical knowledge, it can be really handy! Then the tickets can be reviewed by the team to fit better the project you are developing.</p><p><strong>But</strong>, I want to stress out, the tickets created by default by ChatGPT are definitely <strong>not ready to use</strong>. Props might need to be changed based on your requirements, the accessibility suggestions might not be on point, etc. But.. do not forget, OpenAI models can be trained by providing prompt and result examples so they can create something closer to your needs. Worth the time? I guess depends on how different the tickets you create are, how need to be written, why, and what is your company/team process.</p><p>In the end, it was really cool to achieve what I had in mind with my first attempt. Now I got a better idea of how ChatGPT API works and definitely there is more I can learn about it.</p><p>Curious? Here is the GitHub repo of the project: <a href="https://github.com/Vanals/Jira-tickets-with-ChatGPT">https://github.com/Vanals/Jira-tickets-with-ChatGPT</a></p><p>And</p><p><a href="https://www.linkedin.com/in/marco-vanali/">https://www.linkedin.com/in/marco-vanali/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fed2123b67a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Christmas Hackaton: Speech Recognition and Synthesis]]></title>
            <link>https://marcovanali.medium.com/christmas-hackaton-speech-recognition-and-synthesis-74ae2da268d7?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ae2da268d7</guid>
            <category><![CDATA[speech-synthesis]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[webapi]]></category>
            <category><![CDATA[user-experience]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 16:34:50 GMT</pubDate>
            <atom:updated>2023-01-20T19:48:36.037Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNf2RvMU-l5NO0pQRYchjA.png" /></figure><p>Every year, NewsUK hosts a Christmas Hackathon, and this year, I decided to take part and explore the possibilities of using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API">speech recognition and speech synthesis WEB APIs</a>. I wanted to see how they could be integrated into our projects and what kind of impact they could have.</p><h4><strong>The Idea</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ClW8cA2STc6x1upI" /></figure><p>As part of the Newskit team, one of our goals is to keep our documentation website polished and up-to-date. To make it easy for users to find the information they need, we have an efficient text search area. Users can type in keywords and a list of related links will appear, allowing them to easily find what they’re looking for.</p><p>But I thought, wouldn’t it be even cooler if you could “ask” the website? And be taken directly to the information you need, without having to type and then scroll through a list of options. Of course, creating something great in just 2 days and doing it alone is a big challenge, but I was determined to create something cool. <br>The main goal for me was to play with the Speech Recognition and Speech Synthesis Web APIs and see how it can be integrated into our projects.</p><p>By using these technologies, we were able to create a solution that allows users to search for information using their voice. This not only makes the experience faster but also more accessible for users with disabilities. In this blog post, I’ll take you through the process of how I tackled this challenge and the results I achieved.</p><h3>The spark</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*o7jYaNncKEBfif0y" /></figure><p>I first learned about these APIs months ago while watching an accessibility video from Apple (<a href="https://developer.apple.com/videos/play/wwdc2022/10153/">https://developer.apple.com/videos/play/wwdc2022/10153/</a>). They discussed many new techniques and features for enhancing website accessibility, but the idea of using speech recognition and synthesis for web navigation stood out to me.</p><h3>The Planning</h3><p>For this project, I was joined by my colleague Aysha. Together, we divided the work into tasks using FigmaJam, so that we could work in parallel and stay focused on our MVP. It’s easy to waste time on non-essential features, but by using this method, everything was clear and we were able to use our limited time effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4r5lMth_gCBgysB6jVaiHA.png" /><figcaption>I love using FigmaJam, helps me a lot to organize any project work I do.</figcaption></figure><h3>Newskitta</h3><p>And below here is the Vocal Search component we have built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5It6jLuFbX2Ov1_kh5Xn7w.gif" /></figure><p>Have also loaded a quick demo on YouTube: <a href="https://www.youtube.com/watch?v=BaJ9pMQx0wo">https://www.youtube.com/watch?v=BaJ9pMQx0wo</a></p><p><strong>What is made of:</strong> We added a new Icon Button in the navigation bar, next to the search input. Clicking on it opens a modal where Newskitta (the cute robot) greets you. <br>The modal’s interface contains a collapsible “How to guide”, a “microphone on/off” text to let you know when you are being listened to, a button to start speaking, and a transcript of what you said.</p><p><strong>How it works:</strong> You click on the “How to talk” button, speak your query(examples in the guide), and Newskitta asks you if you are happy with what they captured. If you confirm, they will search and take you straight to the page you were looking for. If not, you will be prompted to try again. The experience is very smooth and allows for interaction in case of errors so you can try again.</p><p>It was really exciting to see our product come to life and respond to voice input. The Web Speech API has definitely made significant advancements in recent years and it was impressive to see it in action. It was a great experience to work with these technologies and see how they can be used to improve user experience and accessibility</p><p><strong>API Implementation</strong>: Implementing and using the APIs was relatively easy. We installed the react-speech-kit NPM package and went through the documentation to understand the different parameters we could use, such as starting and stopping listening and controlling Newskitta’s speech. We also utilized the native Web Speech Synthesis API to personalize the voice. This allowed us to choose from different voice shades, accents, pitch, and speaking speeds. In addition to the API logic, we also had to write functions to search through our website for the correct link. Overall, it was a fun and educational experience and basically built a little intelligence to communicate with!</p><h3><strong>Challenges</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*9HdNoWqgocFM3-eP" /></figure><p>Time was a major challenge, as we only had 2 days to build the experience, make it feel fluid, test it, and prepare a presentation. However, since we were familiar with our website and Newskit, it made the process easier. We had to learn about a new API, make it work in React( react-speech-kit wasn’t our first attempt!), write the script to search properly through our JSON, give user feedback and create a nice user experience</p><p>Even though the speech recognition was surprisingly good, it did not work well in every browser. When we tested it in Safari, our sentences were hardly captured correctly. However, there are other third-party services that can be used to replace the browser’s native speech API.</p><p>Finally, <strong>If I had more time</strong>:</p><ul><li>I would have explored voice confirmation, as currently, I need to click yes or no. I attempted to implement it but it was challenging.</li><li>I would have expanded the script to find anything on the website.</li><li>I would have made Newskitta more clever by suggesting search options in case the user asks for something that is not literally there but is similar.</li><li>I would have explored different Speech API services.”</li></ul><p>Thanks to the right alignment of many stars, we managed to get the majority of the votes and arrive first in the competition!</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ae2da268d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Updating the team process to improve Web Accessibility]]></title>
            <link>https://marcovanali.medium.com/changing-the-team-process-to-improve-web-accessibility-a11y-e9733bb14150?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9733bb14150</guid>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[web-accessibility]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[agile]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Wed, 03 Feb 2021 22:00:26 GMT</pubDate>
            <atom:updated>2022-06-28T14:43:54.748Z</atom:updated>
            <content:encoded><![CDATA[<p>at NewsKit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*5Ov0VNpnGvvdSoV4s_ghgQ.png" /></figure><h4>But first, an update from me</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*sVA8ROMenCh834rCYE5g4Q.gif" /></figure><p>During the past year, after the fantastic experience at <a href="https://medium.com/vodafone-uk-engineering/what-i-learned-from-a-hackathon-at-vodafone-7a6fd3860d2c">Vodafone</a>, I have been working at <strong>NewsUK</strong>, joining the <strong>NewsKit</strong> team! <br>Here,<strong> I have been mainly growing around</strong> React.js, CircleCi, A11y, Typescript and contributing to building a new <em>design system; </em>where my team takes the name from.</p><p><strong>In this blog post, I want to tell you about</strong> <em>NewsKit</em> and how we have been improving the accessibility of our components enhancing the team process.</p><h3>What is NewsKit?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Q2znZNTewxcZlMopzYAbWQ.png" /></figure><p><a href="https://medium.com/newskit-design-system/introducing-newskit-a-themeable-design-system-for-unique-media-brands-6a2d770e2bbb">NewsKit</a> is a <strong>design system</strong> built on <strong>React.js</strong>. It aims to provide interactive, flexible, and accessible React components for creating digital products. <br>We are already using NewsKit for internal projects here at NewsUK, and in the future, it will be released as open-source.</p><p>But! Fortunately for you, you can already make use of its potential. <br>To know more about the library, I would like to point you to “<a href="https://medium.com/newskit-design-system/introducing-newskit-a-themeable-design-system-for-unique-media-brands-6a2d770e2bbb">Introducing newsKit a themeable design system for unique media brands</a>”, and the official <a href="https://www.newskit.co.uk/">NewsKit</a> website, where all the documentation sits.</p><h3>The A11Y challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*eh0FE4yFptVhyQFp0ZVaAA.gif" /></figure><p><em>Working in a new company, or in a new team, always brings new challenges and learnings, from pure coding to soft skills.</em><br><strong>One of the missions</strong> I and the NewsKit team had to face was to build <strong>accessible React components</strong>.</p><p>I wasn’t being exposed to accessibility before this role but I have immediately found it interesting, easy to learn, and satisfying to implement. <br><em>When you like something it is always easy to pick up!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*xMzmc4KfkJVmfTypkPHKMA.gif" /></figure><p>During the implementation of our components, we started realizing we could do better<strong> </strong>from the accessibility point of view.<br>We noticed some issues with the contrast ratio, keyboard flow, and VoiceOver not giving the expected information to the user.</p><p>We needed more planning. More thinking with accessibility in mind before writing any line of code and while doing that. Then, test more with screen readers, and of course, pay more attention to accessibility during the code reviews.</p><p>Quick to say but to bring the whole team on the same page takes time and clarity on how to achieve it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*gJt0il2InRIygTLHSJwy9g.gif" /></figure><p>I have then started working on my knowledge around A11Y, and contributing more and more during our meetings with recommendations.</p><p>But me doing that couldn’t work and be solid enough. Ideally, everyone had to take part in it, planning, researching, and taking accessibility into account prior to and during development.</p><h4>The Plan</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*EU6xu_WJt94PTXX9SG0LgQ.gif" /></figure><p>To make it more clear to myself and to the team I first created a quick map of how I did visualize the new team process, deciding when the accessibility research had to start, how had to be executed, and the ideal outcome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*41V3yUmSzkkmelsoxLH77g.png" /></figure><p>Just <strong>above you can see the map I created</strong>. It is quite self-explanatory and does the job. As you can see I have proposed to add<strong> two new steps and influence a few others</strong>.</p><p>In the first rectangle, the phase where a need for a new component comes up. Next, the component design; even if white the design step is fundamental, is where lots of work around accessibility can be already done. Be sure that c<em>olor contrasts, font sizes, how the user is supposed to interact, etc satisfy WCAG guidelines.</em></p><p>After that…</p><p><strong>THE NEW STEPS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/138/1*CpHj92zBm36doujIM3o1lA.png" /></figure><p>The aim of this meeting is for the <strong>engineer</strong> <strong>to</strong> <strong>understand</strong> the functionality, get familiar with the design, and start to think about the HTML structure of the new component, key for accessibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/142/1*OH-4njO_7ad0hxwa1-2b9Q.png" /></figure><p>After the necessary information have been collected the<strong> engineer can now investigate</strong> how to make the new component accessible. Thinking about the HTML structure; which Aria properties might be needed, how they work and how to enable them; what the <a href="https://www.w3.org/WAI/standards-guidelines/wcag/">WCAG</a> guidelines say about it, and of course test everything with a screen reader.<br><em>(Ideally with all the most used: JAWS, NVDA, and Voiceover)</em></p><p><strong>The outcome</strong> should be a <strong>detailed document</strong> to present and share with the team members. It should explain, step by step, how a user would interact(with keyboard and without), what would be read by the screen reader, and any other relevant <a href="https://www.w3.org/WAI/standards-guidelines/wcag/">WCAG</a> recommendations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*_uPrrpqkic1z8ddNQ5XGYw.png" /><figcaption>Steps influenced by A11y research</figcaption></figure><p>These yellow actions on the left were already existing steps, which now require more attention from the team. <br>It means double-checking that the a11y recommendations have been taken into account and applied in the code.</p><h4>The trial</h4><p>Ultimately <strong>we have experimented with this approach</strong> for one of the new components we are building, the <strong>Modal dialog</strong>.</p><p>A modal dialog is known for not being always an easily accessible web component. But if built correctly it can be smoothly used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/0*5IaYkfIJwW3TXV2-" /><figcaption>NewsKit Modal first designs</figcaption></figure><p>I tried the process for the first time, documenting and sharing it with the team.</p><p><strong>Once started, I mostly based myself on</strong> the <strong>WCAG</strong> guidelines, recollected important learnings from <strong>online courses</strong> I previously did, and obviously, I have <strong>tested </strong>with the screen reader.</p><p><em>I will never stress enough how important is to manually test your a11y recommendations.</em> <br>Be aware of how it sounds listening to the screen reader going through your component, and realize if it makes sense to you.</p><p><em>If it does not make sense for us it won’t make sense for our users either.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XjPSuLgBtsqHU2xW" /><figcaption>NewsKit Modal concept</figcaption></figure><p><em>Some of the key information the research included were:</em></p><ul><li>Step by step <strong>how a keyboard or mouse user would have interacted</strong> with the Modal.</li><li>Where the <strong>focus</strong> should go on open, on close, and how to set it with Javascript.</li><li><strong>Tab trapping</strong>, what it is, and how to achieve it.</li><li>The need to be able to <strong>close the modal</strong> on overlay click or on ESC press.</li><li>The necessary <strong>ARIA</strong> attributes, how the <strong>screen reader</strong> would have guided the user through the Modal.</li><li><strong>Libraries </strong>that<strong> </strong>could help us out, to avoid reinventing the wheel.</li></ul><p>This is a very short summary but important to understand how granular I believe we should go. Sharing and discussing these requirements prior to development is fundamental.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxYfxvn43831ggp_Gy8nLA.png" /><figcaption>Testing and documenting SR behavior</figcaption></figure><p>T<strong>he research did bring insight to the whole team</strong>, raised more awareness around A11Y, and led us to important decisions about how to tackle this complex component.</p><p>Fortunately for you, the Modal has been not released! and do not hesitate to check what else we have already built for you on the <a href="https://www.newskit.co.uk/">NewsKit</a> website!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*dU7rCo2FhASnlhN0Cj1alA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9733bb14150" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Accessibility: Should I use aria-level in the <h > tags?]]></title>
            <link>https://uxplanet.org/should-i-use-aria-level-in-the-h-tag-8efc2cd0a114?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8efc2cd0a114</guid>
            <category><![CDATA[web-accessibility]]></category>
            <category><![CDATA[a11y]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[aria]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 21:38:25 GMT</pubDate>
            <atom:updated>2020-04-05T20:41:46.278Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*rJy8xNdh1_AoSdSlSlWksg.png" /></figure><h4>Daily challenges</h4><p>In my current job, when new components are made or enhanced, we often implement features to make them more accessible. One of the last conversations we had was about <em>applying </em><strong><em>aria-level=”1&quot; </em></strong><em>in the &lt;h /&gt; tags</em>.</p><p>In order to give my feedback, I did some researches and wrote this post hoping to share some useful information with people who are facing similar doubts; contributing to a more accessible web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*SvhJqJfL3fKppWst7IWRIQ.gif" /><figcaption>Me writing this post after one working day</figcaption></figure><h3>Use aria-level?</h3><p>If you have a meeting in exactly…<em>one second,</em> I will go straight to the point in the next line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Pmxy4UpzMKg4Q_AhiJmbng.gif" /></figure><p><strong>We should not use aria-level</strong> in the &lt;h /&gt; tag. If not for retro compatibility reasons.</p><h4>When, in theory, can aria-level be used?</h4><p>If for some reason you must use a div and you are trying to let it look like a header, to a screen reader, then you will need to declare its level and role.</p><blockquote>&lt;div role=’header’ aria-level=’3&#39;&gt;Hello Marco&lt;/div&gt;</blockquote><p><strong>But best the practice is to not using a &lt;div /&gt; to replicate a &lt;h /&gt; tag.</strong> In fact, the &lt;h&gt; tag<strong> </strong>has already everything you need; a role=’header’ and an area-level inherited.</p><blockquote>&lt;h3&gt;Hello Marco&lt;/h3&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*RtHL82NeOXYy4YrARkzicg.gif" /></figure><p>One way to doublecheck this is by opening your Chrome developer tool Inspect a &lt;h &gt; tag and open the accessibility window. In there you will be able to see the role and level of the element inspected. You will realize that your heading has a level and role by default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMULoEHQK3yaAn8mwDERnw.png" /></figure><h4>So, aria-level does something but the best practice is not to use it.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*dpmuI2WRHGKkMhtSXqp5ag.gif" /></figure><ol><li><strong>Not needed: </strong>The &lt;h x&gt; tag already provides the level to the header. It is no needed to pass a level 1 to an h1, or a level 2 to an h2 etc. It is inherited.</li><li><strong>Do not give an aria-level value divergent from its &lt;h /&gt; tag level:</strong> Why an h3 should have a level 1? If the developer believes its position is an h3, in the hierarchy, then it should have a level 3.</li><li><strong>No same aria-level in all the &lt;h x/&gt; tags</strong>: It sounds pretty obvious but of course we should not have a default same aria-level on all the &lt;h /&gt; tags making them <em>“look”</em> all at the same level. It also defeats the purpose of a nice HTML structure, and the headers have an important role in that.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*14TtZfHl2K3A3w7t4oQb-Q.gif" /></figure><p>Secondly (but not secondly) some users with disabilities browse the web using the screen reader’s router. One of the sections of the router is the “Headers”, a section which allows the user to see a list of all the headers present in the page and their level. So <strong>having everything as a level 1 or 2 would disrupt this hierarchy of the page not giving any advantage.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*zzi4yikUFQlKM-2z0XwZMA.png" /></figure><blockquote><strong><em>Some nice synthesis and concepts found during my research</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0sDBp9cKPDH4iw8OdxjVBA.png" /><figcaption><a href="https://www.practicalecommerce.com/Understanding-ARIA-for-Web-Accessibility">https://www.practicalecommerce.com/Understanding-ARIA-for-Web-Accessibility</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yEBU_sRUc-LGkiqXS_QLbA.png" /><figcaption><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/heading_role">https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/heading_role</a></figcaption></figure><p><em>Before thinking about any aria attribute consider your semantic HTML5</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*nP6hhj0FBDIqBTmZfKIAPg.gif" /></figure><h4>TO FOLLOW ME</h4><p><a href="https://www.linkedin.com/in/marco-vanali/">Linkedin</a></p><p><a href="https://twitter.com/vanali_marco">Twitter</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fb3e808%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fb3e808&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7ecd953714a6022a3456ca263d5f43b/href">https://medium.com/media/a7ecd953714a6022a3456ca263d5f43b/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8efc2cd0a114" width="1" height="1" alt=""><hr><p><a href="https://uxplanet.org/should-i-use-aria-level-in-the-h-tag-8efc2cd0a114">Web Accessibility: Should I use aria-level in the &lt;h &gt; tags?</a> was originally published in <a href="https://uxplanet.org/">UX Planet</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I learned from a hackathon at Vodafone]]></title>
            <link>https://medium.com/vodafone-uk-engineering/what-i-learned-from-a-hackathon-at-vodafone-7a6fd3860d2c?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a6fd3860d2c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[vodafone]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 12:26:32 GMT</pubDate>
            <atom:updated>2020-04-01T13:20:41.686Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_RzvICq1q3jmRilR5Jf2uA.png" /></figure><p>I bet everyone has heard what a hackathon is, but if you didn’t:</p><blockquote>A <strong>hackathon</strong> is an event, usually hosted by a tech company or organization, where programmers, students and sometimes even professors get together for a short period of time to collaborate on a project.</blockquote><p>Currently, as a contractor, I am working full time at Vodafone and get the chance on a regular basis to participate with the hackathons organized there.</p><p>I believe hackathons are a great way to break up your coding routine; develop applications using new technologies or approaches; adding value to the company and yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*zyC1qNMRK5Jt2nAypZjDjA.gif" /></figure><h3>The story</h3><p>A couple of weeks ago I took part in one of the internal hackathons organized at Vodafone, where two teams were competing with each other.</p><p>My colleague <a href="https://medium.com/u/1cb2be9f3fbb">Danielle Booysen</a> and I were one of the teams and in less than 2 days we’ve been able to build a<strong> <em>dev tools application</em> </strong>named:</p><h4>Web Console Recruiter.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Y_KeXr0HRplizV4gm-y7Tg.gif" /></figure><h4>The idea</h4><p>As it’s not always easy to engage developers through the usual ways, through the classic recruitment process, we wanted to build something to help and improve this process.</p><p>We conceived an app which runs in the browser <em>developer tools console </em>allowing the company to engage and grab the attention of developers who explore the Vodafone website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*YtlMJRjO2GbeQASZx8w_4A.gif" /></figure><p><strong><em>How</em></strong> Danielle and I captured the developers’ attention would have been essential. We wanted to develop something new, something <em>a </em>developer<em> wouldn’t expect</em>, something to have <em>fun</em> with and at the same time <em>not invasive</em>.</p><h4>The Research</h4><p>After some initial investigations, we soon acknowledged that few companies already do try to grab the attention of developers through unusual ways using the browsers developer tools. The approaches we have found were very simple. Most of the companies just print a plain black small logo and their <em>‘careers’</em> URL in the console and… that’s it!.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*0rsdps0BFBz447nvRoqRyg.gif" /></figure><p><strong><em>A great idea,</em></strong> using the console, but could it be improved? is it really engaging? We wanted to do something else and improve this approach.</p><h3>How?</h3><p>The core of our plan was building a game!</p><p><strong><em>A</em> <em>technical quiz to be played in the console.</em></strong></p><h4>Planning</h4><p>After our expedition on the internet, we planned our following two days.</p><p>Given that developing an application which runs inside the browser <em>developer tools console </em>was <strong>something new</strong> for us, <strong>we explored and tried some new javascript libraries</strong> and approaches<strong> </strong>to achieve our goals.</p><p>We had to decide <strong>if</strong> and <strong>how</strong> to use Ascii art, animations, and images in the console; create a way to let the developer interact with our quiz, style the text, architect a nice flow, writing the actual Q&amp;A and last but not least prepare a nice presentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*urOwkLPVCUY-O6-bRjg4ow.gif" /></figure><h4>Tasks splitting</h4><p>Once our plan was ready we defined and split the tasks, drew up an MVP and set time limits. We only had two days, half-day was already gone and we wanted to bring a working product which had the potential to be great!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*O6J6OwzgA8QxUp7qORUchA.gif" /><figcaption>Me and Danielle getting ready</figcaption></figure><h3>The outcome</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*UqD2oijDZ5TQWJHOUIOHFw.png" /></figure><p>In less than 2 days we achieved everything we planned and more. Using Vanilla Javascript we build a <em>mini technical quiz</em> for developers which run in the browser <em>developer tools console</em>; inclusive of images, styled text, and customized commands to play it.</p><h4>How it works</h4><p><em>Briefly</em></p><p><em>1)</em> When the developer opens the console for exploring the HTML elements, the network tab or for any other reason, they get a <strong><em>curious</em></strong> <strong>welcoming message</strong> in the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*1qIU9PqsUIN3d92dWPw4UQ.gif" /></figure><p>What is shown in the console is unexpected! It is colorful, styled with emojis, images and shows the company logo grabbing the developer’s attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*D8OoxqJpdYYbLUZEGJGPyg.gif" /></figure><p>2) The welcoming message is then followed by a text which explains the basic rules and the commands for playing the quiz.</p><p>The application is run through commands such as start() and reply() which the developer will have to use in order to finish the quiz replying to <strong>random</strong> questions taken from a collection we have control of.</p><blockquote>Yes <strong>random.</strong> One of the features of our app is that the questions change and are shown in a different order every time the quiz starts. In this way inquisitive developers will not have the same quiz again.</blockquote><p>3. Once the developer has replied successfully to all the questions a final <strong>congratulation message </strong>and the <strong>career URL</strong> are shown!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*D_PDaB6N3H6jmnxZ5DQR1Q.gif" /></figure><h3>Why do I think the quiz works?</h3><p>First of all, it is more than printing a URL or a white and black logo.</p><p>Our app prints images, styled text, colors, emojis. It prints something that the eyes of a developer are not used to see in a browser <em>developer tools console</em> adding value to the company.<br>Secondly, it is a mini quiz! Which requires the active participation of the developer and <strong><em>tend to be felt like a game, a fun challenge rather than a recruitment process</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*KUJjJFxK7RQpElKghEcK3Q.gif" /></figure><p>In summary; looks great, has smooth user experience and works!</p><h3>In the end</h3><p>Other reasons why we have been really satisfied with <strong>our</strong> work is because it <strong>can be easily implemented in <em>every</em> web application</strong>. The <strong>code is clean</strong> and has minimal usage of JS packages! [<em>Only one actually, which we’ve added for time reasons but that can be easily removed and replaced by one javascript function]</em></p><p>Furthermore, its <strong>style is flexible. </strong>The images, the company logo, the texts can be easily changed or restyled with CSS. <br>The quiz’ questions and their quantity can be modified as well.</p><p>We believe it could add value, has <em>potentials to be improved and be more effective</em>!</p><p>On top of that, we had fun and learned new things!</p><p>Finally, we won the hackathon which made us really happy and proud. We built a great tool and ran a great presentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_RzvICq1q3jmRilR5Jf2uA.png" /><figcaption><a href="https://medium.com/u/1cb2be9f3fbb">Danielle Booysen</a>, I and the Web Console Recruiter application</figcaption></figure><p>Feel free to follow me!</p><p><a href="https://github.com/Vanals">GitHub</a><br><a href="https://www.linkedin.com/in/marco-vanali/">Linkedin</a></p><p><a href="https://twitter.com/vanali_marco%20Linkedin:%20https://www.linkedin.com/in/marco-vanali/">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a6fd3860d2c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vodafone-uk-engineering/what-i-learned-from-a-hackathon-at-vodafone-7a6fd3860d2c">What I learned from a hackathon at Vodafone</a> was originally published in <a href="https://medium.com/vodafone-uk-engineering">Vodafone UK Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understand basic Webpack from scratch]]></title>
            <link>https://medium.com/swlh/understand-basic-webpack-from-scratch-6a1976565ae0?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a1976565ae0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[basics]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Fri, 31 May 2019 11:51:27 GMT</pubDate>
            <atom:updated>2020-11-27T10:08:09.205Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*bFwEsviFxStAYwOBW_36hA.png" /></figure><h3>Understand the basics of Webpack from scratch</h3><p>The first time I heard someone speaking about Webpack, or even a bundler, for me it was like hearing an alien language, an abstract thing, which was doing something magical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*E8RnI0PgoDgmTIiTSxc3og.gif" /></figure><p>But as I love challenges, I decided to explore Webpack and see if we could become friends, or, just ignore each other like in the best love stories.</p><h4>How I dealt with it</h4><p>What worked well for me was creating a simple javascript repo from scratch and then trying to apply Webpack to it and of course, googling and reading the Webpack documentation when needed as they were water(or a good prosecco!)</p><p>We are now going to create a simple repo from scratch and play a with Webpack to understand its fundamentals.</p><h4>What I‘ve used for this project</h4><p>[Node.js](<a href="https://nodejs.org/en/">https://nodejs.org/en/</a>),</p><p>[Yarn](<a href="https://yarnpkg.com/lang/en/">https://yarnpkg.com/lang/en/</a>)</p><h4>Let’s start!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*6mlw_7grQAEFPCkwQM2LsQ.gif" /></figure><h3>Folder and package.json</h3><ul><li>Create a folder called <strong>basic-webpack-bundle</strong></li><li>Inside it create the package.json running the command</li></ul><pre><br>npm init -y<br></pre><ul><li>Install Webpack</li></ul><p>For this tutorial, I’ve used Webpack 4 and Webpack-cli 3.<br><strong>Refer to these packages version for following this tutorial:</strong> <a href="https://github.com/Vanals/medium-basic-webpack-bundle/blob/master/package.json">package.json project</a> .</p><p>Even if we are not using Webpack 5 here, this is still a great tutorial for understanding how Webpack works! <br>Lastly, Webpack4 is still amply used!</p><pre>yarn add webpack@4.32.2<br>yarn add webpack-cli@3.3.2</pre><h4>Create the Webpack configuration file</h4><p>[Webpack doc](<a href="https://webpack.js.org/">https://webpack.js.org/</a>).</p><blockquote>Out of the box, webpack won’t require you to use a configuration file. However, it will assume the entry point of your project is <em>src/index.js</em> and will output the result in <em>dist/main.js</em> minified and optimized for production.</blockquote><p>Once installed the Webpack basic packages <strong>create</strong> the<br><strong>webpack.config.js </strong>inside the root folder, which as its name says, is the configuration for our beloved bundler.</p><p>Once created add the following code</p><pre>const path = require(‘path’);</pre><pre>module.exports = {<br>  entry: ‘./src/index.js’,<br>  output: {<br>    path: path.resolve(__dirname, ‘dist’),<br>    filename: ‘bundle.js’<br>  }<br>};</pre><p>Ok! Now let’s take a deep breath and see together what is happening over here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*OW4xNSnrRXo46_SFxS0jJA.gif" /></figure><p>In the first line, we are <em>requiring</em><strong><em> “</em></strong><em>path”</em> which comes with NodeJs.</p><p><strong>Path</strong> = <em>The path module provides utilities for working with file and directory paths.</em><br>For example, it is used to resolve the absolute path to the project’s root directory (which is where webpack.config.js is usually located)</p><p>Then, we are exporting our module which at the moment contains only two keys.<br>The <strong>entry</strong> <strong>point</strong> which is the file that Webpack will run through to create our bundle.<br>The <strong>output</strong> which contains sets the name of our final bundle file and where to place it.</p><p>Now that we know what these basic lines are doing let’s create what we need, which is our entry point file, index.js.</p><ul><li>Either manually or simply using your mouse create a source folder and the index.js</li></ul><pre><br>mkdir src<br>touch src/index.js<br></pre><ul><li>Then add some simple code to let it carry on one task</li></ul><pre><br>window.onload = function() {<br> console.log(‘Thanks Marco Vanali!’)<br>};<br></pre><h3>Create and Launch our first bundle</h3><p>Cool! Now let’s see how to bundle our simple index.js file through Webpack.</p><p>Now let’s run Webpack aiming to the config file we have created, by running the following command</p><pre> yarn webpack --config ./webpack.config.js</pre><p>As an outcome, we will see a new folder, named <strong>dist</strong>, which contains our bundle.js.</p><p>bundle.js would be a single file that contains all our compressed javascript.</p><h4><strong>PS:</strong><br>For simplicity and because we are good guys let’s create directly a script in our package.json; in this way, we will just run *yarn bundle* rather than have to remember this lovely line of code.</h4><ul><li>In the package.json replace the script object with the following</li></ul><pre><br>“scripts”: {<br>  “bundle”: “yarn webpack --config ./webpack.config.js”<br>},<br></pre><p>The flag`— config` is what allows us to specify the name of our Webpack config file. In this case, we would not even need it because webpack.config.js is what is going to be used by default.<strong> <em>— config is very useful in case you want to use different config files for different scripts.</em></strong></p><h3>Launch</h3><p>The time is near, we now want to launch our repo and see the outcome of the index.js file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*sUE6s4x0nI9Gb_MrDBsb8w.gif" /></figure><p>So far we have a javascript file that contains our logic, but what else we need in a basic web site project other than javascript?</p><p>An HTML file to host it!</p><ul><li>Create an Html file in the <strong>root folder</strong> and require our bundle.js in there</li></ul><p><em>By default Webpack is looking for the index.html file in the root folder, of course, it might not be where we want to place it but we will see how to decide its location later below, bare with me.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*1UigZg_fSk8kcztPzrjVcA.gif" /></figure><ul><li>import the bundle.js file inside the index.html file</li></ul><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;title&gt;&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h1&gt; Well done learning more about Webpack &lt;/h1&gt;<br>    &lt;script type=&quot;text/javascript&quot; src=&quot;./dist/bundle.js&quot;&gt;&lt;/script&gt;&lt;/body&gt;<br>&lt;/html&gt;</pre><p>At this point, we want to run our app. <br>We could simply open our index.html, but we might get a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS</a> error in some browsers so not the ideal approach, but what we really want is use the power of Webpack to customize our server through <a href="https://webpack.js.org/configuration/dev-server/"><strong>webpack-dev-server</strong></a><strong>.</strong></p><p>Let’s install it</p><pre><br>yarn add webpack-dev-server -D</pre><p>Now in our <strong>package.json</strong> we can add a second script. One for building our bundle and then another one for starting our app in the browser.</p><p>Like so:</p><pre><br>“scripts”: {<br> “start”: “yarn webpack-dev-server --config ./webpack.config.js”,<br> “build”: “yarn webpack --config ./webpack.config.js”<br>},<br></pre><p>So running <strong>yarn start</strong> we will run our app using <a href="https://webpack.js.org/configuration/dev-server/"><strong>webpack-dev-server</strong></a>.</p><p>But we still need to write the configuration for it. And guess where?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*d98B4QS8Rt8V7-TKLf1hRw.gif" /></figure><h3>Configure the dev server and move the index.html</h3><p>What if we want to configure settings such as the port we run our app, where to take the content from, execute custom middleware, etc?</p><p>As we said<strong> webpack-dev-server</strong> is going to <em>serve </em>our bundle.js using the index.html file placed in the root. In order to configure it we have to go to the webpack.config.js and add in the <strong>module</strong> object the <strong>devServer</strong> key and the basic following properties:</p><pre><br>const path = require(‘path’);</pre><pre>module.exports = {<br>  entry: ‘./src/app.js’,<br>  output: {<br>    path: path.resolve(__dirname, ‘dist’),<br>    filename: ‘bundle.js’<br>  },<br><strong>  devServer: {<br>    contentBase: path.join(process.cwd(), ‘dist’),<br>    compress: true,<br>    port: 8050<br>  }</strong><br>};<br></pre><p><strong>port =</strong> specifies the port where to run the server<br><strong>contentBase</strong> = specify the path where the webpack dev server will find all the necessary files ( index.html and bundle .js).</p><p>Now that we are using <strong>webpack-dev-server</strong> and getting more control on our app we will meet a little issue</p><p>If we now run our repo:</p><pre> yarn start</pre><p>it won’t work anymore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*ngfP3M_Cr_IDtA3njMcG1g.gif" /></figure><h4>Why?</h4><p>This happens because, by default, the <strong>webpack-dev-server</strong> will be looking for our index.html inside the dist folder and nowhere else.</p><p><strong><em>In order to fix that, </em></strong>once finished to work on our HTML file<strong><em> </em></strong>we could create a copy of it and paste it manually inside the dist folder.<br>Right?<br>Obviously no!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*40Wgc7D-Gk1l5uT99z4Ckg.gif" /></figure><p>That would mean we have to copy manually the index.html every time we make changes.<br>(<em>Ye but I could keep it in the dist and work there! </em>That is even worse! You should not work in your dist folder.)</p><p>What an option could be? <strong>Well, what the build would include the index HTML in the dist folder, taking it from the root?</strong></p><p>In this way, everything would be automatic and the human race would not be necessary anymore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*2kUUlpdkaFNuBcT2sEholw.gif" /></figure><p>Ok, maybe this is a bit too much but gives an idea!</p><h3>Html Webpack Plugin</h3><blockquote>Webpack works mainly via Plugins and Loaders, so if you understand how to use them you are at a really good point:</blockquote><blockquote><a href="https://stackoverflow.com/questions/37452402/webpack-loaders-vs-plugins-whats-the-difference">https://stackoverflow.com/questions/37452402/webpack-loaders-vs-plugins-whats-the-difference</a></blockquote><p>In order to achieve our goal, we can use a Plugin called <a href="https://webpack.js.org/plugins/html-webpack-plugin/">HtmlWebpackPlugin</a></p><ul><li>Install the plugin</li></ul><pre><br><br>yarn add html-webpack-plugin -D<br></pre><ul><li>Add the plugin in our webpack.config.js, which should now look like that</li></ul><pre><br>const path = require(‘path’);<br>var HtmlWebpackPlugin = require(‘html-webpack-plugin’);</pre><pre>module.exports = {<br>  entry: ‘./src/app.js’,<br>  output: {<br>    path: path.resolve(__dirname, ‘dist’),<br>    filename: ‘bundle.js’<br>  },<br>  devServer: {<br>    contentBase: path.join(process.cwd(), ‘dist’),<br>    compress: true,<br>    port: 8050<br>  },<br>  plugins: [new HtmlWebpackPlugin({<br>    filename: ‘index.html’,<br>    template: ‘./index.html’<br>  })]<br>};<br></pre><p>As you can see we’ve created a new key inside our module called <strong>plugins.</strong></p><p>Its value is an <strong>array, </strong>where each item is a plugin. As you can see we are initializing <strong>HtmlWebpackPlugin</strong> and then passing as arguments our specs:</p><ul><li>The name of the file to create, <strong>filename</strong>,</li><li>and the HTML file to use as <strong>a template</strong>, to copy.</li></ul><p>Now <strong>move the index.html file </strong>from the dist folder to the root folder<br>The root path is where now we are aiming to take it as we wrote in the template key.</p><p>Before to try it out, add some text changes in the HTML file and REMOVE the script we used to import the bundle.js with.</p><p>Why do we want to remove it? because our HTML plugin is going to take care of that as well! Is going to automatically add the import of the file specified in the entry point key in our webpack.config.js file.</p><h4>Let’s now build!</h4><pre>yarn build</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*UQwODaVTQg56NaZDaZAZSQ.gif" /></figure><p>Wuah! Look there! our dist folder now has our index.html file!<br>And looks like exactly like the one we have in the root!</p><p>Now</p><pre>yarn start</pre><p>and go to <a href="http://localhost:8050/">http://localhost:8050/</a><br>Wuala, our bundle, placed in the dist folder is served.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*7E_qvIrvW8pc_bujk4A4mA.gif" /></figure><p>There are lot’s of improvement and configuration we could add to our Webpack config file and repo. But I hope this little exercise helped you to be less scared of it and understand it.</p><p>It is not a bad guy at the end, isn’t it?! I actually like it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*jrXTZvBqG5fGCvOqV2UQCA.gif" /></figure><h3>BONUS, Someone said SCSS and Loader?</h3><p>Let’s quickly do the last thing, for reinforcing our understanding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*tZfg9EZ3NogMm1Hz7uwOiQ.gif" /></figure><ul><li>Inside the src folder, create another folder called style and inside it, one file called main.scss</li></ul><pre><br>mkdir src/styles<br>touch src/styles/main.scss<br></pre><ul><li>Add in the scss file the following code:</li></ul><pre><br>body {<br> background: tomato;<br> margin: 0;<br> padding: 0;<br>}<br></pre><ul><li>Import your SCSS file in the index.js file placed in the src folder</li></ul><pre><br><br>import ‘./styles/main.scss’<br></pre><p>Cool! Now we have the styling imported, so everything should be fine, right?</p><p>If you now try to build the app Webpack is gonna tell you exactly what you need.</p><blockquote>You may need an appropriate loader to handle this file type.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*f_3wnKOM7fL0_v7ISnq5Zg.gif" /></figure><p>You need a Loader. This because <strong>by default Webpack is only capable to bundle js files</strong> and in this case, we need something to first of all convert scss to css and then css to js!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*HNlDPG4AlGhv9oMBhJbcpw.gif" /><figcaption>SCSS becoming JS</figcaption></figure><h4>sass-loader</h4><p>The loader we will use is <a href="https://github.com/webpack-contrib/sass-loader">sass-loader</a>.</p><ul><li>As its documentation says, let’s install the following packages</li></ul><pre>yarn add style-loader css-loader sass-loader node-sass -D</pre><ul><li>Add the loader in the <strong>module.exports object</strong> of your config file adding a new key called <strong>module plus the following set up.</strong></li></ul><pre>module: {<br>  rules: [{<br>   test: /<strong>\.</strong>scss$/,<br>   use: [<br>  &quot;style-loader&quot;, // creates style nodes from JS strings<br>  &quot;css-loader&quot;, // translates CSS into CommonJS<br>  &quot;sass-loader&quot; // compiles Sass to CSS, using Node Sass by default<br>   ]<br>  }]<br>}</pre><blockquote>The module key, in the config file, is where we generally add the loaders.</blockquote><p>Cool! The big part is done. Now run again</p><pre>yarn build</pre><p>Now if you would go to your bundle.js and look for the word <strong>tomato</strong> (the background color we chose in the scss file) we will find it in there!</p><p>It is a good sign, isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*b-nFJ4yk8Sv3DqtiwGeaag.gif" /></figure><ul><li>Now run</li></ul><pre>yarn start</pre><ul><li>Go to</li></ul><pre><a href="http://localhost:8050/">http://localhost:8050/</a></pre><p>and enjoy the tomato background! we did it! well done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*5d88KjXw4Dk7BYE0FWs0OA.gif" /></figure><p>Again, I hope again this was helpful to understand basically how Webpack works! Feel free to <strong>drop a comment if you have any question</strong> and <strong>follow me</strong> for more contents.</p><p>On the internet, there are lots of resources for understanding more deeply Webpack and see what other amazing things you can do with it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*x6liXNw0Ac76LL4ID_ZR7Q.jpeg" /></figure><p>You can find <strong>the repo of this project here, in my GitHub</strong>:<br><a href="https://github.com/Vanals/medium-basic-webpack-bundle">https://github.com/Vanals/medium-basic-webpack-bundle</a></p><h3>Personal:</h3><h4>TO FOLLOW ME</h4><p><a href="https://www.linkedin.com/in/marco-vanali/">Linkedin</a></p><p><a href="https://twitter.com/vanali_marco%20Linkedin:%20https://www.linkedin.com/in/marco-vanali/">Twitter</a></p><p>Do you want to know more about me?<strong> read how I became a developer </strong><a href="https://medium.com/@marcovanali/a-journey-from-nursing-to-web-developing-34aa44a153ae">https://medium.com/@marcovanali/a-journey-from-nursing-to-web-developing-34aa44a153ae</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a1976565ae0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/understand-basic-webpack-from-scratch-6a1976565ae0">Understand basic Webpack from scratch</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring new Technologies]]></title>
            <link>https://marcovanali.medium.com/exploring-new-technologies-e57c8cc884de?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e57c8cc884de</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Mon, 19 Mar 2018 13:25:00 GMT</pubDate>
            <atom:updated>2019-06-07T11:09:46.803Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*SjzlqJ2U6amL44hAJmFoMg.gif" /></figure><p><em>This is my second post regarding my experience in London as a Web developer. To know more about me, to know my story, how I became a Web Developer click </em><a href="https://medium.com/@marcovanali/a-journey-from-nursing-to-web-developing-34aa44a153ae"><em>HERE</em></a><em>.</em></p><p>The graduation day has passed. After the graduation you might think you can finally relax, calmly study, explore London but… no!</p><p>The war is open. You have to find a job and get ready!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*0qYkvfSRuqu_-hxKGMHWAA.gif" /></figure><h4>What have I been up to?</h4><p>Since the end of the course. I practised with technologies I’ve explored during Makers Academy; such as React, ExpressJS, MongoDb, WebSocketJS but also preparing for interviews. There is never enough time to fully complete either of those activities. You always wish have more time for studying, learning from Udemy course or practising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*hpuj7I-ZFhoCW8ElzjRqMw.jpeg" /></figure><p>In the last period, I felt ready to explore new technologies to expand my knowledge and be given new challenges. I decided to play around with technologies I always heard about, Swift and Angular.</p><p><strong>Swift</strong> is a compiled programming language developed by Apple for iOS, macOS, watchOS, tvOS, and Linux. <strong>Angular </strong>(commonly referred to as “<strong>Angular 5</strong>” or “<strong>Angular 2</strong>”) is a TypeScript-based open-source front-end web application platform led by the Angular Team at Google and by a community of individuals and corporations.</p><h3>Swift</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*i6FbV1QJJre1h-Rc3CyGCg.png" /></figure><p><em>I have always been fascinated by building mobile applications</em> and thus, Swift is one of the technologies which does that. I wanted to learn something that was also outside my skill Set so yes, I could have chosen React Native but believe Swift was really out there to reach.</p><p>To take the first steps to learn this new language I followed a Udemy course and the official Swift documentation.</p><p>Udemy is a great platform to get you to learn the foundations through building projects. It’s a method that makes you feel you are producing solid outcomes whilst learning along the way. After all, it gets really dense when you type in theories without having to execute them.</p><p>So, I started with this first project:</p><h4><a href="https://github.com/Vanals/What-is-your-age">What is your age?</a></h4><p>The purpose of this app is to calculate your age based on your birth year. You input the year you were born, click the button and voila, it shows you you’re age. Might be useful if you forgot how old you are!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8ewBVWakFY4Z7Xlu36Tlg.png" /></figure><p>To develop I had to use a new IDE, XCode. The development is quite different that what I was used to. Normally, I would use ATOM. Although, the management of UI is totally different!</p><p>Coding with HTML, CSS and REACT, I had to produce the outcome of each element by coding. In XCode, you can select your element(texture, button etc) and drop in on the user interface. In addition, you can use a menu to change the colour, font-size, position, etc.</p><p>For the start, it seemed a bit confusing. I suppose if it’s a more creative software like Photoshop, it makes sense but I hadn’t really used many creative softwares.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DOnoF1_JAnvcEPSiqQEN6A.png" /></figure><p>Then I got to code. In this app I had to let happen an event when a button was clicked. What is cool is that you can just select your element for the UI and connect it in your ViewController.swift file where the code happens. Then from there, you can create your variables and methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*YNuE2Kmd9df68Og2SC93MA.png" /></figure><p>One of the main difficulties I found in creating an app that looks good independently, in dependant of which device you use. In fact, the mobile phone screen’s size might depend on the device and your elements might then not be in the right position. For example, the “Find age” button, in a Iphone5S was getting too small and the written wasn’t showed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*-D_tjfobSnwC2D0LkpE3Sw.png" /></figure><p>Though, I sorted it out just reducing the the font’s size.</p><p><strong><em>Considerations</em></strong></p><p>Develop a simple mobile app using Swift has been quite fun and satisfying. The management of the User Interface seemed easier given is not necessary to code for building it. At the same time the Menu hide a lot of functionality that can’t be grasped so quickly. In addition, the possibility to link easily the UI elements with the basic logic make XCode an interesting tool.</p><p>Exploring and developing in Swift has been fun and is a technology I would like to know more.</p><h3>Angular</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*Y547A1WkJDBXb4OYF_JSjg.png" /></figure><p>My first love will always be React no matter how similar these two may be. However, I wanted to have a go to the alternatives such as Angular, one of the most popular front-end libraries. I wanted to get an idea of how Angular is similar with react but in a different way. Thus, I wanted to give Angular a chance to catch my interest the same way React did.</p><h4>The permissions nightmare.</h4><p>My experience with Angular was not all too bad. It didn’t have many troubles at all except for one thing. I had a a very bad experience with installing Angular. For some reason, I couldn’t install it because my permissions for my NodeJs was set differently. Then, very wisely(<strong><em>joking</em></strong>) I followed a guide to sort out the problem, which ended causing more issues and with the need to format my laptop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*waFQG3-St3ibx-Oy3JL-9Q.gif" /></figure><p><strong>What happened?</strong></p><p>Basically, on my laptop for installing packages globally I had to use the command <strong>sudo</strong>, which didn’t allow a correct installation of Angular. On GitHub, several developers advised to follow the point 2 of the following guide (<a href="https://docs.npmjs.com/getting-started/fixing-npm-permissions">https://docs.npmjs.com/getting-started/fixing-npm-permissions</a>). Initially everything was working fine but after I restarted my laptop, several commands such as ‘ng and react’ started to do not be recognised anymore: <strong>command not found</strong>. Thanks to the help of the fantastic coach Kay this issues has been sorted out, but few warning and errors still came out then under her advice i reseted my loved Macbook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*-6c5Z4mbxHx_O3LMyA3cvw.gif" /></figure><p>After this beautiful adventure and after I set up again all my dev environment I decided to have another go to install Angular, that time with success, it couldn’t escape from me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*uEzJ7xy7nh3t0wjBw5P7tA.gif" /></figure><h4>The App — Tour of Heroes</h4><p>Following the Angular documentation I built a Web App called <a href="https://github.com/Vanals/Angular-tour-of-heroes"><strong><em>Tour of Heroes</em></strong></a><strong><em>. </em></strong>It sounds cooler than it is. All it is, is an app that shows a list of heroes which you can select and then edit the name. Despite it is a simple Web App include the basic event you would put in a project.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CO6qCdutDswYXt4geZgjw.png" /></figure><p><em>[Yes, I am a hero]</em></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <strong><em>Building it I had the opportunity to understand the basics:</em></strong></p><ul><li>Styling an Angular component</li><li>Using two way data binding with the ngModel directive</li><li>On click events</li><li>map a TypeScript list in the HTML file</li><li>Use and if statement in the HTML file</li><li>Learn how Angular and type script work together</li></ul><p>One familiar thing that I’ve found is that Angular as well as React has <strong>components, </strong>which are like bricks of your applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*znxK1nAjEua6JEJ0fYEZAw.png" /></figure><p>By default, the Angular project has the app component to render. Then inside it I could put your other components and build your app.</p><p><strong><em>The app component came with few files ready for me:</em></strong></p><ul><li>A CSS file</li><li>A HTML file to write the html code will be rendered by Angular., it’s HTML not JSX.</li><li>Spec. Test environment</li><li>.ts file= the component class code, written in TypeScript.</li></ul><p>From my humble point of view I’ve found Angular less friendly. Perhaps it could be because of Typescript, which initially was a bit confusing given the unique syntax. It is quite different to normal vanilla javascript and suppose it was something I was not used to.</p><p><em>Angular is indeed a library I would use again but for the moment React stays my one true love.</em></p><h4>My exploration so far. Was it worth it?</h4><p>It is always good to learn new languages or libraries, especially through projects. It not only trains your brain to adapt to other ways or writing code but shows you what’s in the market out there. It hones in on why you love certain softwares and trains a strong quality a developer has:</p><p>To go out of your comfort zone for learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*cI5mMKciDj-qXISXFXTRow.gif" /></figure><p>If you can do something that you usually don’t do,</p><p><a href="https://github.com/Vanals/CV-1">https://github.com/Vanals</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e57c8cc884de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A journey from Nursing to Web Developing]]></title>
            <link>https://marcovanali.medium.com/a-journey-from-nursing-to-web-developing-34aa44a153ae?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/34aa44a153ae</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[makersacademy]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Thu, 15 Feb 2018 18:52:56 GMT</pubDate>
            <atom:updated>2020-04-01T13:22:34.671Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*c0VUkzONLm-EJdojsDkU0Q.gif" /></figure><p>My name is Marco. As you are reading the blog title, this post is the story of my journey of who I was to who I am now and how my life changed in one year.</p><h3>FIRST STEP: Opening the University’s door and discovering the world:</h3><p>In the region of Sardinia, I<strong> studied Nursing</strong> since 2012 and in April 2016 I graduated. As a young graduate, I was ready for something different and ready to find my way outside a library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*pzUwW-a_x2-KppBZQ3Bsrg.gif" /></figure><p>If you don’t know <strong>where Sardinia is</strong>, it’s an ‘island’ which is part of Italy and is placed in the Mediterranean Sea.</p><p>It has sunny skies, warm temperature and is great for an amazing vacation. I had a comfortable home, parents that cooked for me, no rent to pay, friends. Practically everything and I was ready to work…but something was missing. I realised, after 3 years of university exams and internships in hospitals that I wanted something more <strong>or something different</strong>(?).</p><p>Since I was a child, I always wished to live in a big city. Whether it was to go to events or discover every corner, I decided to find my way in another country where the time is one hour forward. The United Kingdom. Moving there, I was exposed to a culture that was entirely different. A culture with a different language I had to learn, a weather I had to adjust to and a place very far from my loved ones and comfort zone. All I could think was ‘what an adventure!’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*sGKhEfzbebvhfmPKt8qcXQ.gif" /></figure><h4><strong>Prepping for the departure:</strong></h4><p>As I had to accustom to a foreign place, I had to intensively study English during the summer. (Young Marco regrets as he didn’t pay a lot of attention during the lessons. Bad Marco!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*WwR4NKuIgdaPGpF2Nk_TIA.gif" /></figure><p>Anyway, in May I applied for a job through an recruitment agency. I passed the interview and ended up getting a job in a Hospital close to London. I was happy, scared, but in somewhere deep inside me, I was sure that was the right decision. Then October 2016 came and I departed to the United Kingdom. With 3 big luggages, 2 eye bags and a soul of determination I went to live in a little town called Aylesbury.</p><p><em>Alone.</em></p><p>I mean, without anyone but, I knew I would have found either other Italian guys or other company to be friends with.</p><h3>SECOND STEP: Rediscovering and following a different passion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*fEDBXe_Ii31O8xVoyBuQzw.gif" /></figure><p>Once I arrived, I quickly made friends with the other students recruited by the agency. Sooner or later, I found myself living with some of them in a flat.</p><p>The first two weeks in UK weren’t so bad. I had to just go to some events, learn how the NHS was structured and how my job would have been. Once I started to work I was quite motivated. I got to enter the industry and got to know a lot of people. Though, I slowly realised that what I had studied for 3 year wasn’t really what I wanted to do for the rest of my life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Vg38HWh2GooeP9A_NJo_Iw.gif" /></figure><h4>The research</h4><p>Once I realised that work in a hospital wasn’t for me, I decided to follow what was(and continues to be) my passion, coding and technology.</p><p><strong>“Why coding?” one could say.</strong></p><p><em>I think that the coding development process require a lot of skills such as creativity, intelligence, passion, the ability to work in a team and to have fun! I had all of them. In addition when I see that my code works, when I see all the green lines in my tests, when I see that look like nice and other people might find it useful… ooh! it is so satisfying!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*uD-aXr-lnD-fKme30ZImNg.gif" /></figure><p>Since I was studying nursing, in Italy, I used to manage a blog and a community for Italian nursing students(<a href="http://www.lostudenteim.it/">http://www.lostudenteim.it/</a>) playing with HTML and CSS. I really liked coding but I wasn’t ready yet to change my path towards the tech world.</p><p>But finally I had London next to me, one of the biggest city in the world, full of opportunities. I could do everything.</p><p>I just needed two things:</p><ol><li>A good course to became a Web Developer.</li><li>Money!</li></ol><p><strong>Ok let’s start with the money.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*xh8wC_pjsX64FpUr6O6HXw.gif" /></figure><p>So I had a job and I didn’t like it, but i needed money. I then decided to keep working in the hospital in order to change my life and get the chance to became a Web developer. I was sure that a good course and London would have been enough!<em>(spoiler: I was right!)</em></p><p>In terms of the <strong>course</strong>, I spend more or less two weeks googling and looking for the best courses that would help me. After a while, I found Makers Academy. A 12 weeks coding bootcamp, one of the best intensive course in Europe for web developers.</p><p>I asked feedback from other Italian guys that joined MA in the past and all of them told me: “It is great!, it changes your life!, a lot of my colleagues and I found quite quickly job after that!”</p><p><strong><em>In short, it sounded…</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*e1Wvyqg74rDdanvLLzfI6A.gif" /></figure><h3>THIRD STEP: Interview and Relocation</h3><p>The decision was clear. In March, I applied to Makers Academy.</p><p><strong>To join in the academy</strong>, it is necessary pass an interview/test and only 10% of the people that applies pass it.</p><p>They gave me some material to <strong>study</strong> for the interview preparation. During my days off, I studied Ruby, which was the topic I will have been tested in. In two weeks, I had to study a programming language completely new for me. They suggested me this awesome book <a href="https://pine.fm/LearnToProgram">Learn to program, by Chris Pine</a> (also called from me Chris PAIN! Ok this one was bad, but the chapter 10 is the hell!). It is really well done, everything is explained clearly, also for a newbie.</p><p>After two weeks of intense study I went to London for the <strong>Interview</strong>. I was really really nervous. I was worried because I didn’t do all the exercises of the book and I wanted to be sure to do not lose this opportunity but two weeks is not a lot of time, especially if you are working full time.</p><p>Once I arrived in the academy, it seemed the heaven to me. It didn’t seems like when I used to stay close in a classic university, studying boring topics with boring teachers. There, it was full of guys with their laptops, coding, following lessons and everyone was enjoying themselves. It looked like Hogwarts. Just much smaller and for Web developers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*PqosjZjXYrm7ckeYVhJ7KQ.gif" /></figure><p>After being interviewed for one hour, I could go home. Although they would let me know one week later, I was worried to have lost my chance I didn’t know if <strong>I passed the test</strong>.</p><p>After a painful week, I receive the email. I passed it. I passed the interview! A place was booked for me for the October cohort 2017! I was so happy! Well done Marco, another step towards a new future!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*OrjpvYKxJ3T7pUKDTiaUuQ.gif" /></figure><p><strong>September</strong></p><p>September was the last month at Aylesbury. On the 15th, I quit my job at the hospital, had a dinner with my flatmates to say ‘goodbyes’ as it was rare for me to see them in the near-future.</p><p>On the 16th, I moved to London. It was a stressful that day from finding a good flat with good flat mates. That was quite the challenge.</p><p><em>I take this opportunity to thank again everyone I met that year at Aylesbury. All the guys I worked and lived with. Good or bad, they helped me to grow and helped me find my way.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGVwIz1D_qGVGzCaaCTiWQ.jpeg" /></figure><p><strong>At the end of September</strong> I started the<strong> pre-course. </strong>Each week I had a different challenge to pass.</p><ul><li><em>On the first week</em> I worked on a very fun <strong><em>Mystery Challenge.</em></strong> In which I had to find the killer, browsing through a bunch of files and folders using the command line. I learnt a lot of cool commands.</li><li><em>Second week</em>, I studied the whole book<strong><em> ‘Learn to program By Chris Pine’</em></strong>. Book that teach you the basic of Ruby.</li><li><em>Third week</em>, I created a Student Directory using Ruby. It was quite fun. To build it, I followed user stories given by MA. At the end, I was impressed by what I built. I mean, it was my first ‘project’. If they would have told me<strong><em> ‘Build a student directory with ruby’ in the first week</em></strong>, I wouldn’t have known where to start but following the users stories, step by step, it came automatically.</li><li><em>Fourth week.</em> It was the introduction to <strong><em>pairing over the FizzBuzz challenge in Ruby</em></strong>. In this week I met some of my future colleagues to pair with. Everything seemed more and more real.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*ejGwJWCurMuoVaME2NqFOg.gif" /></figure><p>In addition, since week two I had to do <em>Katas on codewars.com</em> and level up every week. I really couldn’t wait to start the real course. Study every day, for four week, in a room, alone, was quite boring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*99SmJdaHzcpd-8eQH2yzJQ.jpeg" /></figure><p><strong><em>Little advice for who would like to join makers Academy:</em></strong></p><p><em>Theoretically, during the pre-course, it is said that you can work but I would suggest to do not. Maybe maximum 2 days at week. In this way, you can focus properly on learning and improve your coding skills. Improvement takes time and patience. It is not just about getting a result. It is about understanding how and why you got it and see if your approach can improve.</em></p><h3>FOURTH STEP: <a href="https://medium.com/u/5fa7fd928efe">Makers Academy</a></h3><p>The big day arrived. 23 October was the <strong>first day at Makers Academy</strong>.</p><p>I was quite excited on that day. Once I arrived, I met some guys I coded with during the pre-course and the rest of the other colleagues. My cohort was populated by people from different countries. From Venezuela, Portugal, Malaysia, Belgium, Germany, Spain, it was a very multicultural group.</p><p>We spoke about our background, why we choose to follow a new passions and why at Makers Academy. We were getting to know each other whilst more importantly, we were <strong>trying to find a new comfort zone</strong>. Who knew that:</p><p><em>It was the beginning of an awesome experience that I will bring with me for all my life.</em></p><p>During the rest of the day the coaches introduce themselves. We explored the Academy and immediately started with some pairing session going through a little ‘pairing’ challenge.</p><p>It was an intense day as people were communicating a lot. I remember that my brain was so tired that it stopped working at night.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*4yeWD-0K1UPEO_zg0k29KQ.gif" /></figure><p><strong>During the first week, </strong>we slowly discovered Makers Academy.</p><p>The building is divided into four floors.</p><ul><li><strong><em>The first floor</em></strong> was where the staff’s offices were, including the careers team who was in charge of helping us to find a job.</li><li><strong><em>Second floor</em></strong>: workshop rooms, ping pong table(<em>vital</em>), relax area with sofa and the kitchen. Every day in the kitchen we had free breakfast and it has enough space for us to eat lunch.</li><li>On the <strong><em>third floor</em></strong> there is a big area full of desktop screens. Here is where we spent most of the time; coding, studying, struggling and learning.</li><li>Finally, at the <strong><em>fourth floor</em></strong>, there is a little area with other desktops. Here is were the graduated students go to keep studying and job-hunt until they find a job.</li></ul><p>On the second floor is where extra-curricular activities happened as well. Every day there is Meditation, Yoga is every Tuesday and Thursday, Game night on Wednesday and social drinks on Friday.</p><p>On need is also possible ask for counselling sessions.</p><p>A very cool environment I would say. We were cuddled; but we had to work hard to reach our objectives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*OQL2M08x317bhwjygt5o1w.gif" /></figure><p><strong>Daily schedule at MA</strong></p><p>I usually arrived at Makers early, around 8:30 am to go back at home around 6/6:30 pm. I like start to work early in the morning, otherwise I feel like I am wasting my day. Although, that schedule was quite exhausting, but what mattered is that it was productive. This happened from Monday to Friday.</p><p>During the weekend, no rest of course! We had to do our weekend challenge. It can take both days if you really want( some time I did it), but I would suggest to take at least one or half day free going back to the reality and saying hello to some squirrels.</p><p>Everything was going well, I was studying, learning a lot and growing. After 6 weeks I started to feel the weight of the course. When they said that is intensive, they really mean that <strong><em>(and a crush on a girl didn’t help)</em></strong>.</p><p>During the first half of the course, 6 weeks, we learnt:</p><ul><li>Git and GitHub</li><li>Ruby and its framework such as Rspec, Sinatra, Capibara Ruby Rails.</li><li>Javascript Vanilla with Jasmine and Node.js.</li><li>How to work in a team, practising pair-programming, agile and XP every day.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*b4np_iaYln1XAJVu_ttd9w.gif" /></figure><h4>Little break for Christmas</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*GToMuE-IWYOgtkFJeZ3xbA.gif" /></figure><p><strong>In December</strong>, we had a ‘break’. During the Christmas holiday Makers Academy closed for one week. All of us where quite tired and we needed a rest. Someone stayed in London, someone else went back to its parents. I took advantage of that to go to Italy and spend the vacation with my family, my friends an the Sun.</p><p><em>Yes, the Sun. Since the beginning of the course I practically didn’t see it. I was getting a vampire.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*U7_a2vVD2WefgjCuCBvFPQ.gif" /></figure><p><strong>During the holidays</strong> I kept coding to maintain my skills and improve. Of course, I also enjoyed my free time.</p><p>I came back on 30 December as the course would then begin on 2 January 2018(no time to waste man!).</p><h4>January</h4><p>was the last month. I still had 3 weeks left. I spent the <strong>first week</strong> doing tech tests individually. In particular, I did the Bank and the Gilded rose challenge in Javascript. The tech tests are a good opportunity to check your level, work a bit by your own and focus on what you think need to be reinforced.</p><p><strong>The last two weeks</strong> were dedicated to the <em>final project</em>. The objective was to develop it in teams. The teams consist of four to six people and they are decided randomly by the coaches in base of which kind of project you wanted to build.</p><p>All of us were excited, willing to smash it, build an awesome final project and be ready for the job world.</p><p>In the end, I was assigned to a group of five. My group was composed by Allan, Theo, Marie and Antonio. We were the ‘<strong>Quiz Life</strong>’ group, which the name comes from our project.</p><p>Quiz Life is a full-stack Javascript web app that allows you to create quizzes and play them <strong>in real-time </strong>with your friends using a mobile-friendly interface. For the more curious is possible to find the project here, in my GitHub <a href="https://github.com/Vanals/Pub-Quiz">https://github.com/Vanals/Pub-Quiz</a>.</p><p>To develop Quiz Life, we decided to challenge ourselves with a new Javascript library for the front-end, React. For the back-end we used MongoDB, ExpressJS, Node.js, WebSocketJS, ExpressWs. For test frameworks, we used: Mocha, Chai, Sinon, Supertest and ZombieJS. Majority were new for me.</p><p>We worked very hard. We paired, did regular retros, stand ups, had many beers, learnt a lot and had fun!</p><h3>FIFTH STEP: Graduation Day</h3><p><strong>19 January</strong> was an important date for me. On that day, I finally saw the first part of my journey to became a developer closing as my first career fair was happening. One year before, I would have never imagined that I would have been here, in London, presenting my project as Web Developer.</p><p>It was amazing.</p><p>On that day<strong> I woke up </strong>at 7:30 am, I was very excited. It took a while to get ready but it was an important day. I had to shave my beard, my hair and eat breakfast. At the end, it took so long that I was afraid to be late and had to take the Uber.</p><p><em>Looking good takes time.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*Rd3a7c2ol19HzknJYKHrEQ.gif" /></figure><p>The next step was the<strong> Careers Fair.</strong> It happened at 11:00 am<strong>. </strong><em>I don’t know why the Careers fair and graduation happens on the same day. It might be a strategy to do not let us overthink in the morning or just to avoid we mess up the code at the last minute? Who knows? A Makers mystery.</em></p><p>I arrived just in time, at 10:50 am. The Careers Fair started in 10 minutes. I had the time to relax and speak a bit with some colleagues to reduce the tension. The Careers team did a great job for us as there were six companies that day. Not all of them were looking for an huge amount of developers. Some companies was looking just 1 or 2. Nonetheless, it was a great occasion to throw myself into the breach.</p><p>The clock strike 11:00. The Careers Fair started. Each company presented who they were. They spoke about why we should choose them, what they do, what tech stack they use and the benefits they offer. During the presentations I was taking some notes, in order to remember their specifications once the chat would have started. This was vital for the next step. At the end, I had to jump into the fire and network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*L395OXA6JHTMcnMkWZxEZA.gif" /><figcaption>Me jumping into the fire.</figcaption></figure><p>It was a great experience. I had the opportunity to speak with the companies I was interested in, know more about how they work, what they do and how the environment is. It was useful and fun.</p><p>Once the Careers Fair was finished, I had lunch with my colleagues and now my attention moved again to the final project. I had to be good. I wanted to do the best I could. My part consisted in showing the Demo explaining to the public what was happing and how our App worked. It might sound easy but English is not my first language so I needed to do a bit of practice. The hardest thing was be in sync with the video, but after a couple of try I was ready!</p><p>The graduation started at 5:00pm. I still had some time to relax. I used the time chatting with my colleagues. Every one was trying to relax. The tension was so strong you could cut with the knife!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*_gmQimgX79R46L3J99E6mw.gif" /></figure><p>The moment arrived. It was 5:00pm. Everyone was ready, all who came sat in the chairs. Two coaches were presenting at the graduation, Edward and Kay. I saw other two presentations before and resonated with them. You could feel how the developers are happy and moved.</p><p>Five teams had to present the final project, my team was the third.</p><p>Our moment finally came. We went in front of the designated position and started our presentation. We were all nervous. Allan introduce the group and the idea, then one by one, following the slides, we presented the project.</p><p>But guess what? During my part the video interrupted! It was a particular moment because all the attention was on me. To my surprise, I kept calm and with the help of Kay, I could use another version stored locally..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*NbyHXBDyzsgpoQPchIn_8w.gif" /><figcaption>Me telling to my self to keep calm</figcaption></figure><p>After that, I could finally chill and enjoy the moment watching the last groups. At the end with the whole cohort I went to a pub to celebrate the event! We had finally finish(?), we were finally Developers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*FP5mF1Nk042Goh2FdjXEeg.gif" /></figure><h4>General Thanks</h4><p>What can I say? I’ve learned more in the last year than in five year of high school. It has been an amazing experience that, with sacrifice, allowed me to grow, see a new part of the world, learn a new language, meet new people, open my mind and be ready for a job that I like. I am really thankful to all the people I met, and I had the chance to talk with. All of them in some way gave something… .</p><p>Now the Job-hunting experience has started.</p><h4>TO FOLLOW ME</h4><p><a href="https://www.linkedin.com/in/marco-vanali/">Linkedin</a></p><p><a href="https://twitter.com/vanali_marco%20Linkedin:%20https://www.linkedin.com/in/marco-vanali/">Twitter</a></p><p>GitHub : <a href="https://github.com/Vanals/CV-1">https://github.com/Vanals/CV-1</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*OdIuu1WKs-rvht0zT_h-BA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34aa44a153ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Come Installare e Testare ExpressJS]]></title>
            <link>https://marcovanali.medium.com/come-installare-e-testare-expressjs-20cbb8b2957e?source=rss-aa7353e57c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/20cbb8b2957e</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[supertest]]></category>
            <category><![CDATA[mocha]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Marco Vanali]]></dc:creator>
            <pubDate>Fri, 09 Feb 2018 08:01:01 GMT</pubDate>
            <atom:updated>2018-03-27T08:25:06.921Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QpUQNIMkxFQ5IKjNGzcJWw.jpeg" /></figure><h3>Installa Node.js</h3><p>Per installare Express.js con questa guida dovrai scaricare ed installare <strong>Node.js</strong> il quale di default avrà <strong>npm. npm </strong>ti permette di installare<strong> </strong>facilmente<strong> </strong>nuove dependencies nel tuo progetto javascript.</p><p>Scarica ed installa Node.js → <a href="https://nodejs.org/it/">QUI</a></p><h3>Installa ExpressJS:</h3><ul><li>Crea la cartella del tuo progetto e raggiungila dalla Command Line. Puoi fare ciò scrivendo i seguenti comandi:</li></ul><blockquote>mkdir my-app-name &amp;&amp; cd my-app-name</blockquote><ul><li>Crea il file package.json per poter installare Express. Scrivi:</li></ul><blockquote>npm init -y</blockquote><p>Questo comando creerà un file chiamato package.json. È un file che ti permette di installare e gestire le dependencies(librarie esterne, frameworks) installate localmente nel tuo progetto.</p><ul><li>Ora installa ExpressJS:</li></ul><blockquote>npm install — save express</blockquote><p><em>La — save flag è quella che salva Express nel tuo progetto, nel tuo package.json file.</em></p><ul><li>Ora nella cartella principale del tuo progetto crea un file chiamato index.js e in esso scrivi:</li></ul><blockquote>const express = require(‘express’)<br>const app = express()</blockquote><blockquote>app.use(express.static(__dirname + ‘/nameFolder’))</blockquote><blockquote>app.get(‘/’, function(req, res) {<br> res.send(‘Hello World!\n’)<br>});</blockquote><blockquote>app.listen(3000, function() {<br> console.log(‘server running on port 3000’)<br>});</blockquote><p>Vediamo in generale cosa fanno le linee che abbiamo scritto:</p><p>Nelle <strong>prime due linee</strong> richiamiamo ExpressJS nel file e lo dichiariamo uguale alla constante ‘app’.</p><p>Nella linea 4, dove usiamo <strong>express.static</strong>, stiamo dicendo ad Express in quale cartella cercare i file che potremo richiedere nelle diverse routes. Per esempio se creiamo un GET route ‘/marco’ e in esso mandiamo un file ‘index.html’, esso verrà cercato nella cartella specificata da questa linea.</p><p><em>È ovviamente possibile specificare la cartella in cui ‘guardare’ per ogni route.</em></p><p>Con <strong>app.get</strong> creiamo una GET route ‘/’ nel quale se visitata verrà mostrata la scritta ‘Hello World!\n’. Quindi, una volta lanciato il server, se noi andiamo su ‘<a href="http://localhost:5000/">http://localhost:3000/</a>’, nell’index page troveremo la scritta da noi decisa.</p><p>Invece, per mostrare il contenuto di un file si può il comando res.sendFile(‘index.html’), il quale verrà cercato nella cartella da te specificata nella linea 4 al posto di ‘nameFolder’.</p><p>Con <strong>app.listen</strong>, stiamo dicendo ad Express in quale porta aprire il nostro server locale. Quindi per accedervi dovremmo andare su <a href="http://localhost:5000/">http://localhost:3000/</a> .</p><p><strong>Per lanciare il server</strong>, nella Comand Line dalla cartella principale, scrivi <em>‘</em><strong><em>node index.js’</em>.</strong></p><p><strong><em>Ora sperimenta creando altre GET route e naviga.</em></strong></p><p>Per maggiori informazioni e introdurre nuove funzioni consulta la documentazione ufficiale di ExpressJS.</p><h3>Test ExpressJS</h3><p>Per testare il nostre ExpressJS useremo<strong> supertest </strong>e<strong> Mocha.</strong></p><p>Nella command Line, stando nella cartella principale(dove sta’ il tuo package.json file), scrivi:</p><blockquote>npm install supertest — save-dev</blockquote><p>Poi installa <strong>Mocha </strong>:</p><blockquote>npm install mocha — save-dev</blockquote><p>&amp;&amp;</p><blockquote>npm install @types/mocha — save-dev</blockquote><p>E in fine, se non presente, aggiungi il testo seguente il tuo package.json file:</p><blockquote>&quot;scripts&quot; : {<br> &quot;test: &quot;mocha&quot;<br>}</blockquote><p>Ora che hai installato le dependencies che ti servono crea una cartella chiamata ‘test’. Mocha guarderà automaticamente in quella cartella alla ricerca di test da eseguire.</p><p>Se ora, nella Command Line, eseguissi:</p><blockquote>npm test</blockquote><p>dovresti vedere un errore che ti dice che non vi sono test files.</p><h4>Crea il tuo test file.</h4><p>Nella cartella ‘test’ crea un file chiamato ‘app_tests.js’ e scrivi il codice seguente:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5ga7eMY9vmeVTdmIBR-tw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TBPvVlVhrN4lUCGNOXe-fA.png" /></figure><p><strong><em>(Invece di ‘app’ noi scriveremo ‘index’, il quale è il file dove abbiamo creato il nostro server Express)</em></strong></p><p>Come si può vedere, il nostro test controlla il contenuto della pagina web nel route ‘/’.</p><p>Ora scrivendo <strong><em>npm test</em></strong> e premendo enter dovresti vedere il tuo test passare.</p><p><strong><em>Per altri test e comandi, consulta la documentazione ufficiale di Mocha e Supertest. </em></strong>Spero che questo post ti sia stato utile.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20cbb8b2957e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>