<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: John McDonald</title>
    <description>The latest articles on DEV Community by John McDonald (@alpinstang).</description>
    <link>https://dev.to/alpinstang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F564660%2Fd84b31f7-d4aa-41df-a389-9fa5611bd7c6.jpeg</url>
      <title>DEV Community: John McDonald</title>
      <link>https://dev.to/alpinstang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alpinstang"/>
    <language>en</language>
    <item>
      <title>How to Resolve Merge Conflicts Quickly, Every Time.</title>
      <dc:creator>John McDonald</dc:creator>
      <pubDate>Wed, 31 Mar 2021 17:16:48 +0000</pubDate>
      <link>https://dev.to/alpinstang/how-to-resolve-merge-conflicts-quickly-every-time-3c92</link>
      <guid>https://dev.to/alpinstang/how-to-resolve-merge-conflicts-quickly-every-time-3c92</guid>
      <description>&lt;h1&gt;
  
  
  How to Fix Merge Conflicts
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DDnLOoUL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1385gccer6d1x25bptis.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DDnLOoUL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1385gccer6d1x25bptis.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
You have been working on a big nice new feature for a few days, or even weeks. All the code is refactored, all the comments are useful, no console prints or debugger lines to be found. It's all ready to ship. You make a pull request. It's almost there. &lt;em&gt;SMACK&lt;/em&gt; You have unresolved conflicts. Please fix these before continuing.&lt;/p&gt;

&lt;p&gt;The pain is immediate and intense.&lt;/p&gt;

&lt;p&gt;Well not to worry. This is a quick step by step guide on how to handle conflicts when merging your branch into, for example, develop. It's simple and foolproof. Here we go.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Do the merge and resolve the conflicts locally:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git fetch
git checkout origin/DESTINATION
git merge origin/SOURCE
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;resolve conflicts...&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Commit File(s)&lt;/p&gt;

&lt;p&gt;git add &lt;br&gt;
  git commit&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Push the merge up as a &lt;strong&gt;new&lt;/strong&gt; branch:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin HEAD:refs/heads/branch-with-conflicts-resolved
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create new PR in Bitbucket and merge it. You have two options to finish&lt;br&gt;
the merge now that you have resolved all conflicts.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Option 1.&lt;/em&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source:       &amp;lt;branch-with-conflicts-resolved&amp;gt;
Destination:  DESTINATION
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Or...&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Option 2.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  - First PR:

        Source:       &amp;lt;branch-with-conflicts-resolved&amp;gt;
        Destination:  branch

  - Complete that PR. Then in another PR:

        Source:       branch
        Destination:  DESTINATION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Now you have resolved your conflicts and merged. :-)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It may seem trivial now, but this is one of the most confusing and frustrating things for developers working in a large agile team environment, where the develop and main branches are changing hour to hour, and week to week, respectively. Hope you are well and happy coding!&lt;/p&gt;

</description>
      <category>git</category>
      <category>bitbucket</category>
      <category>devops</category>
      <category>codequality</category>
    </item>
    <item>
      <title>Ace the Technical Interview: Part 1</title>
      <dc:creator>John McDonald</dc:creator>
      <pubDate>Tue, 09 Feb 2021 23:25:45 +0000</pubDate>
      <link>https://dev.to/alpinstang/ace-the-technical-interview-part-1-32oj</link>
      <guid>https://dev.to/alpinstang/ace-the-technical-interview-part-1-32oj</guid>
      <description>&lt;p&gt;Does your upcoming job interview have you sweating it? Don't worry, it's perfectly normal to feel nervous. However unlike other job interviews where you just have to look like a nice competent human being, developers and engineers are often required to "prove" their knowledge. That chokes up a lot of fresh developers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Nz7yb6pF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ytd064a39l3mcuf8xtfi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Nz7yb6pF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ytd064a39l3mcuf8xtfi.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have your back. In my multi-part guide I'll give you the knowledge and confidence to walk into a big tech interview and shine like you're the next Bill Gates or Woz. 💯 &lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is a live document and chapters will be added below&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction - you are here ✔&lt;/li&gt;
&lt;li&gt;How to talk through problems&lt;/li&gt;
&lt;li&gt;More common Interview Questions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How To Talk Through Problems
&lt;/h3&gt;

&lt;p&gt;Let's say the interviewer asks you to write a program that takes a string and reverses said string. Sounds simple right? Well, it is. But they aren't just looking for you to drop a solution on them. They want to see your problem solving process; How do you think? Here's an example below:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask the interviewer if there are any constraints, physical or otherwise. &lt;em&gt;Does it need to be very memory efficient?&lt;/em&gt; or possibly, &lt;em&gt;Do you need to check for errors?&lt;/em&gt; These are questions that let the interviewer know you're getting all the requirements before jumping into a solution.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Don't go overboard asking for every possible detail either, but a couple general questions really prove you can step back and assess what is needed, before you just impulsively write a function. You can also assess if you should focus on a specific Big O result, such as minimal time complexity, or if it's an IoT device, you may be concerned more about space complexity.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For more on Big O watch this video below&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/__vX2sjlpXU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Let's code! As you're writing the solution, and I'll show you two solutions below, make sure you give a reason &lt;em&gt;why&lt;/em&gt; you are writing each line, what is it doing to help you achieve your goal?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally you're done. Really it's that easy. You already know how to code, so don't sweat it. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;But what if I don't know how to solve the problem?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Well, this can happen, so be prepared. Ask the interviewer for clarification if you think it will help you to solve the problem. If all else fails, explain in pseudocode as best you can what you would do, and explain that you would be reading documentation to find out the specific commands you use to implement your pseudo-solution.&lt;/p&gt;

&lt;p&gt;Getting stuck with a problem you've never faced can happen, just remember, 'I don't know' is the WORST thing to say. In a real job you can't say I don't know, so an interview should be treated the same way.&lt;/p&gt;

&lt;p&gt;Oh, and here is that solution. Two different methods. 😉&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  More Common Interview Questions
&lt;/h3&gt;

&lt;p&gt;I'll be making separate posts with each common interview question and proposed solutions. I may find time to record the process of finding a solution as well.&lt;/p&gt;

&lt;p&gt;Coming 02/11/2021&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading and check back soon!&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Testing React Apps the Right Way</title>
      <dc:creator>John McDonald</dc:creator>
      <pubDate>Mon, 08 Feb 2021 08:18:25 +0000</pubDate>
      <link>https://dev.to/alpinstang/testing-react-apps-the-right-way-5aem</link>
      <guid>https://dev.to/alpinstang/testing-react-apps-the-right-way-5aem</guid>
      <description>&lt;p&gt;I was having endless trouble with tests in my React app, and it was causing my build pipeline to fail as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IsK8-yWz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://1.bp.blogspot.com/-06NpQFp-Cc0/T8_cfS3LoFI/AAAAAAAABS4/_8SoBCn-bD0/s1600/throwing-computer.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IsK8-yWz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://1.bp.blogspot.com/-06NpQFp-Cc0/T8_cfS3LoFI/AAAAAAAABS4/_8SoBCn-bD0/s1600/throwing-computer.gif" alt="Anger"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a few hours of reading documents and cobbling answers from around the forums I found a great, highly flexible solution. There are several places I needed to configure correctly so I'm listing them out below for anyone else that is trying to get their tests up and running and not having any luck.&lt;/p&gt;

&lt;p&gt;Setup your package.json to include these dependencies, and jest configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"devDependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@babel/plugin-transform-runtime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^7.12.10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@babel/preset-env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"7.12.11"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@babel/preset-react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"7.12.10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"babel-jest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"26.6.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"babel-plugin-transform-class-properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^6.24.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"chai"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"enzyme"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^3.11.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"enzyme-adapter-react-16"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.15.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"enzyme-to-json"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^3.6.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"jest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"26.6.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"node-sass"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"4.14.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"react-test-renderer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"17.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"redux-mock-store"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.5.4"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;...other&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;stuff---&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="nl"&gt;"jest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"moduleNameMapper"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;rootDir&amp;gt;/__mocks__/fileMock.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"\\.(css|less|scss)$"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;rootDir&amp;gt;/__mocks__/styleMock.js"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basic test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// &amp;lt;rootdir&amp;gt;/__tests__/app.test.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;assert&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;chai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;shallow&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;configure&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;enzyme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Adapter&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;enzyme-adapter-react-16&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;configureMockStore&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;redux-mock-store&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Provider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-redux&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../src/App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Component to Test&lt;/span&gt;

&lt;span class="nx"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Adapter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mockStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;configureMockStore&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mockStore&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt;

&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Test Component&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;render correctly App component&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AppComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;shallow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Provider&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Provider&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add these styleMock and filemock modules to prevent errors on jsx components importing css/scss and/or files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// &amp;lt;rootdir&amp;gt;/__mocks__/styleMock.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;

&lt;span class="c1"&gt;// &amp;lt;rootdir&amp;gt;/__mocks__/fileMock.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test-file-stub&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// &amp;lt;rootdir&amp;gt;/babel.config.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;presets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/preset-env&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/preset-react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/plugin-proposal-class-properties&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/plugin-transform-runtime&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👩‍💻👨‍💻 ...and &lt;em&gt;now&lt;/em&gt; you should be able to run your tests with jest + enzyme, and in my case, chai. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KOJPAChV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nieuws.testnet.org/wp-content/uploads/2014/04/happy-developer-sq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KOJPAChV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nieuws.testnet.org/wp-content/uploads/2014/04/happy-developer-sq.jpg" alt="happy"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Find Me Here</title>
      <dc:creator>John McDonald</dc:creator>
      <pubDate>Mon, 08 Feb 2021 07:59:37 +0000</pubDate>
      <link>https://dev.to/alpinstang/find-me-here-21ba</link>
      <guid>https://dev.to/alpinstang/find-me-here-21ba</guid>
      <description>&lt;p&gt;&lt;a href="//repl.it/@alpinstang"&gt;repl.it&lt;/a&gt;&lt;br&gt;
&lt;a href="//alpinstang.com"&gt;alpinstang.com&lt;/a&gt;&lt;br&gt;
&lt;a href="//alpinstang.github.io"&gt;alpinstang.github.io&lt;/a&gt;&lt;br&gt;
&lt;a href="//dev.to/alpinstang"&gt;dev.to&lt;/a&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/users/4379163/john-m"&gt;Stack Overflow&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/jmcdonald91"&gt;Twitter&lt;/a&gt;&lt;/p&gt;



&lt;center&gt;Send Doge&lt;br&gt;&lt;br&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q747kvP1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gl0bx8sf8qxzb8r41ihm.png" alt="DGxBQsB3RcNWeWoLgDPDqpyckErXzER2UL&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
"&gt;&lt;br&gt;&lt;br&gt;
&lt;/center&gt;





&lt;center&gt;Send Bitcoin&lt;br&gt;&lt;br&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nSvAaRL0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5o07sfenm5t4w3k7z9k2.png" alt="33AG7c7gsW6fa4kK4hH474Yhw48VfJePdy"&gt;&lt;br&gt;&lt;br&gt;
&lt;/center&gt;

</description>
      <category>social</category>
      <category>websites</category>
      <category>github</category>
    </item>
    <item>
      <title>Let's learn Flexbox!</title>
      <dc:creator>John McDonald</dc:creator>
      <pubDate>Mon, 08 Feb 2021 07:37:02 +0000</pubDate>
      <link>https://dev.to/alpinstang/let-s-learn-flexbox-1o3g</link>
      <guid>https://dev.to/alpinstang/let-s-learn-flexbox-1o3g</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;CSS Flexible Box Layout, commonly known as Flexbox, is a CSS 3 web layout model. It is in the W3C's candidate recommendation stage. The flex layout allows responsive elements within a container to be automatically arranged depending upon screen size.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Category Image Box with Image Zoom Effect Using Flex
&lt;/h3&gt;

&lt;p&gt;While building an ecommerce website I needed a front page that really showcased the products and grabbed the potential customer's attention. Using a beautiful image with elegant category text and a smooth animation really did the trick. I've put the markup and css up on CodePen. I wrote the css in &lt;a href="https://sass-lang.com/"&gt;SASS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/alpinstang/pen/xxEzepB"&gt;CodePen Example&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the process I found a great image placeholder site. Rather than placeholder.com style gray boxes, it provides nice pretty sample images. I recommend it for prototyping and placeholder image content in development. Check it out here: &lt;a href="https://picsum.photos/"&gt;Lorem Picsum&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Happy coding!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;John&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
