<?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: Mirjam Aulbach</title>
    <description>The latest articles on DEV Community by Mirjam Aulbach (@programmiri).</description>
    <link>https://dev.to/programmiri</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%2F42107%2Fda89989d-7649-40cc-81d1-c6d4cf878e73.jpg</url>
      <title>DEV Community: Mirjam Aulbach</title>
      <link>https://dev.to/programmiri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/programmiri"/>
    <language>en</language>
    <item>
      <title>Do we need safe spaces for minoritised people in tech?</title>
      <dc:creator>Mirjam Aulbach</dc:creator>
      <pubDate>Sun, 17 Jul 2022 16:30:28 +0000</pubDate>
      <link>https://dev.to/programmiri/do-we-need-safe-spaces-for-minoritised-people-in-tech-2d2g</link>
      <guid>https://dev.to/programmiri/do-we-need-safe-spaces-for-minoritised-people-in-tech-2d2g</guid>
      <description>&lt;h2&gt;
  
  
  And why my answer is still a big YES.
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This article is originally from Aug 29, 2019. I'm moving my content from medium to dev.to&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In 2019, I’ve spent a weekend at the &lt;a href="https://www.socrates-conference.de/home"&gt;SoCraTes Conference&lt;/a&gt;, an &lt;a href="https://en.wikipedia.org/wiki/Unconference"&gt;un-conference&lt;/a&gt; organized by members of the &lt;a href="https://www.softwerkskammer.org/"&gt;Softwerkskammer&lt;/a&gt;, a community of &lt;a href="https://en.wikipedia.org/wiki/Software_craftsmanship"&gt;&lt;strong&gt;Software Craftspeople&lt;/strong&gt;&lt;/a&gt; whose members are mostly located in Europe.&lt;/p&gt;

&lt;p&gt;One of the values SoCraTes is listing on its website is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, programming language, ability, ethnicity, socioeconomic status, and religion (or lack thereof).&lt;br&gt;&lt;br&gt;
-&amp;gt; &lt;a href="https://www.socrates-conference.de/values"&gt;https://www.socrates-conference.de/values&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I had &lt;strong&gt;four awesome days&lt;/strong&gt;, met great people, found like-minded and different-minded folks to have respectful discussions with, made connections and friends. There were many lessons I took from this &lt;a href="https://en.wikipedia.org/wiki/Open_Space_Technology"&gt;Open Space&lt;/a&gt;, I can’t even wrap my head around all of them now.&lt;/p&gt;

&lt;p&gt;But there’s one thing that stood out, is still very present in my mind, &lt;strong&gt;still bothering&lt;/strong&gt; me. One thing I want to share with y’all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nail polish session
&lt;/h2&gt;

&lt;p&gt;In spirit of &lt;strong&gt;Open Space conferences&lt;/strong&gt;, the topics at SoCraTes covered a wide spectrum. So we had one session about nail polish. Some people brought equipment, some just their curiosity — and nails, obviously. We sat together, did our nails and talked about nail polishing tricks, &lt;strong&gt;wearing nail polish while presenting as male&lt;/strong&gt; and all in between. &lt;/p&gt;

&lt;p&gt;The session was visited by people who identified as women, as men, non-binary folks. It was a really nice and diverse bunch, I had lots of fun. And pretty nails afterwards! Later someone put a lot of the equipment up in one of the lounge areas and gradually the amount of people wearing colorful nail polish grew 🌈&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SjyKrfa---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4ffybf34jqrxlr6ccou.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SjyKrfa---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4ffybf34jqrxlr6ccou.jpeg" alt="Picture taken from above with a lot of different hands on a white table, all with very colorful and often decorated nail polish." width="880" height="660"&gt;&lt;/a&gt;&lt;br&gt;Results of our nail polish session at SoCraTes 2019. Picture credits (and thanks!): Koen Metsu. And yes, there's still work to be done for more diversity in different aspects.&lt;br&gt;
 
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Safe Space
&lt;/h2&gt;

&lt;p&gt;This un-conference was what I consider a &lt;a href="https://www.dictionary.com/browse/safe-space"&gt;&lt;strong&gt;Safe Space&lt;/strong&gt;&lt;/a&gt; in our technology community: A place were people, especially from &lt;a href="https://codepen.io/tatianamac/pen/BaBKoPv"&gt;&lt;em&gt;minoritised groups&lt;/em&gt;&lt;/a&gt;, can feel safe and free of judgment or even harm.&lt;/p&gt;

&lt;p&gt;Coincidentally, we had a discussion about the pros and cons, the need or even harm, of having such &lt;strong&gt;Safe Spaces in tech events&lt;/strong&gt;. The opinions differed, but it was a meaningful and respectful debate. I’m very happy that I had the opportunity for an exchange with other opinions than mine.&lt;/p&gt;

&lt;p&gt;One of the most expressed critics about Safe Spaces (in tech at least) is that they are forcing further separation of different groups instead of supporting inclusivity. It’s a valid argument.&lt;/p&gt;

&lt;p&gt;In my opinion, providing Safe Spaces can be an important step to &lt;strong&gt;enable people&lt;/strong&gt; of underrepresented groups &lt;strong&gt;gaining the confidence&lt;/strong&gt; to join our community.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UD0Csv5I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19xvxy8avu0z0e8glkfv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UD0Csv5I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19xvxy8avu0z0e8glkfv.png" alt="Two pictures, both showing the upper body of a person in a black shirt shirt. The white front says 'Hey guys! Have you hugged a Software Craftsman today?'. The words man and guy are crossed out in red. On the backside, it says: 'Using inclusive language matters!' Followed by the crossed out words 'guys' and 'craftman' and alternative suggestions - all, folks, friends, meatbags crafter, craftperson" width="705" height="399"&gt;&lt;/a&gt;&lt;br&gt;Shirt worn at the SoCraTes 2019, reminding us to use inclusive language. Original pics: &lt;a href="https://twitter.com/coderbyheart/status/1164957001438433280"&gt;https://twitter.com/coderbyheart/status/1164957001438433280&lt;/a&gt;&lt;br&gt;
 
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Leaving this place
&lt;/h2&gt;

&lt;p&gt;For days, I saw people of all kind of genders with colorful nails and nobody seemed to see this as something unusual. White cis-male with glittering nails? So what.&lt;/p&gt;

&lt;p&gt;Then we &lt;strong&gt;left&lt;/strong&gt; the un-conference.&lt;/p&gt;

&lt;p&gt;We took a regional train and were controlled by the train conductor, a middle-aged women, seconds in. The train station is only a few meters from the hotel, so we could still see the Safe Space we just left. My seat neighbor wore blue and yellow nail polish. When the conductor saw this, she commented immediately on it. Telling him that &lt;em&gt;“your nails are ugly”&lt;/em&gt;, people would think he were &lt;em&gt;“into men”&lt;/em&gt; and that he was a good looking guy so it would be &lt;em&gt;“a shame”&lt;/em&gt; that the nails would make him &lt;em&gt;“look gay”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“This is not really happening right now”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;…was all I could think in this moment.&lt;/p&gt;

&lt;p&gt;He reacted great, telling her that he thought his nails looked good. She actually asked about his sexual orientation a few times — like she had any right to do so — but he didn’t answer this questions and just said it didn’t matter if he was into men or women or both. And that his nail didn’t have to do anything with it anyways.&lt;/p&gt;

&lt;p&gt;Honestly, none of us by-sitters knew how to react in that moment and I’m still not sure what would have been a good way to handle this. The women sure noticed that her comment felt inappropriate for us, but &lt;strong&gt;I don’t think that’s quite enough&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now there’s a lesson here
&lt;/h2&gt;

&lt;p&gt;This interaction stayed with me for a while. And with Lucas — you know, the guy with the nice nails — too. He &lt;a href="https://twitter.com/learnerbyheart/status/1167021327544410112"&gt;wrote down his own thoughts&lt;/a&gt; on that encounter and I highly recommend to read it, because it gives you another view.&lt;/p&gt;

&lt;p&gt;In this situation, no real harm was done because my seat neighbor wasn’t fazed and the rest of us was not addressed in that way. But not everybody has — and can have — that kind of confidence. Not for everyone are this kind of things the exceptions but the norm.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;But “Safe Space” sounds like the rest of the world is unsafe!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;I say it is.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Sometimes the rest of the world &lt;em&gt;is&lt;/em&gt; unsafe
&lt;/h2&gt;

&lt;p&gt;What if that comment had been directed at someone who didn’t had that kind of confidence in this moment? I for sure wouldn’t have it! That person could have felt &lt;strong&gt;rightfully&lt;/strong&gt; &lt;strong&gt;hurt&lt;/strong&gt; because another human being just felt the need to tell them something about them was &lt;em&gt;“ugly”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;What if that comment has been directed at someone who was homosexual? That person could have felt &lt;strong&gt;rightfully&lt;/strong&gt; &lt;strong&gt;hurt&lt;/strong&gt; because someone just used the &lt;em&gt;“looking like you are gay”&lt;/em&gt; as an insult. As if the sexual orientation of this person was something that they should be ashamed of.&lt;/p&gt;

&lt;p&gt;I don’t know if other people had similar experiences on their way home. I suspect so. &lt;strong&gt;Every day&lt;/strong&gt; there are people out there who experience this.&lt;/p&gt;

&lt;p&gt;So my stance on still needing Safe Spaces in the tech community was reinforced this weekend and especially through that train ride.&lt;/p&gt;

&lt;h3&gt;
  
  
  We need safe places to let people be. To let them breathe freely.
&lt;/h3&gt;

&lt;p&gt;Let people safely wear nail polish because they want to, not because they have a certain sex. Wear what the heck they want, that is! Love who they want, be sexual attracted to whom they want or not be sexual attracted at all.&lt;/p&gt;

&lt;p&gt;We need to provide places for people &lt;strong&gt;to calm down&lt;/strong&gt;, &lt;strong&gt;recharge energy&lt;/strong&gt; and to &lt;strong&gt;heal&lt;/strong&gt;. To be &lt;strong&gt;empowered&lt;/strong&gt; to deal with the world out there, were people may call you ugly just because you don’t fit their narrow-minded picture of the world.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--McNrhLkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ydth2lhkxi99qqt094pb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--McNrhLkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ydth2lhkxi99qqt094pb.png" alt="Screenhot of a tweet with two pictures, text: " width="880" height="813"&gt;&lt;/a&gt;&lt;br&gt;Results from our Session about fostering diversity in tech (events). Original from Twitter: &lt;a href="https://twitter.com/coderbyheart/status/1165251497476743173"&gt;https://twitter.com/coderbyheart/status/1165251497476743173&lt;/a&gt;&lt;br&gt;
 
  &lt;/p&gt;

</description>
      <category>softwarecrafter</category>
      <category>diversity</category>
      <category>community</category>
    </item>
    <item>
      <title>My favored SCSS setup with Bootstrap 4</title>
      <dc:creator>Mirjam Aulbach</dc:creator>
      <pubDate>Fri, 20 Mar 2020 18:02:13 +0000</pubDate>
      <link>https://dev.to/programmiri/my-favored-scss-setup-with-bootstrap-4-590j</link>
      <guid>https://dev.to/programmiri/my-favored-scss-setup-with-bootstrap-4-590j</guid>
      <description>&lt;p&gt;&lt;em&gt;This article is originally from Aug 25, 2017. I'm moving my content from &lt;a href="https://medium.com/@programmiri/my-favored-scss-setup-with-bootstrap-4-547e9ea290f8"&gt;medium&lt;/a&gt; to dev.to&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can find this setup as an example on github: &lt;a href="https://github.com/programmiri/brunch-setup-bootstrap4"&gt;https://github.com/programmiri/brunch-setup-bootstrap4&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please note that I used this repo also as an example for an article of mine about &lt;a href="https://medium.com/@programmiri/my-favored-scss-setup-with-bootstrap-4-547e9ea290f8"&gt;Setting up Brunch with Bootstrap 4&lt;/a&gt;, so that's the only reason it's based on Brunch.&lt;/p&gt;

&lt;h3&gt;
  
  
  First things first
&lt;/h3&gt;

&lt;p&gt;I already worked with Bootstrap a few times in private projects (e.g. &lt;a href="http://hundetrainer-barcamp.de"&gt;hundetrainer-barcamp.de&lt;/a&gt;) and I really, really like it! It's comprehensible and easy to get started with, even for a beginner. It's been love at the first site!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j1YlOpd0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dpl95bdey0eh0qnn3x4t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j1YlOpd0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dpl95bdey0eh0qnn3x4t.png" alt="Screenshot from tweet saying that I am falling in love with bootstrap" width="602" height="191"&gt;&lt;/a&gt;&lt;/p&gt;
https://twitter.com/mirjam_diala/status/591253430464811008



&lt;h2&gt;
  
  
  My requirements and how I use Bootstrap
&lt;/h2&gt;

&lt;p&gt;I'm using a specific setup and structure for my Bootstrap and SCSS in general. I want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use only selected components of Bootstrap instead of having the whole Bootstrap CSS in production&lt;/li&gt;
&lt;li&gt;customize Bootstrap easily without touching the Bootstrap core files or overwriting styles over and over again&lt;/li&gt;
&lt;li&gt;getting a neat and clean CSS in the end :)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My folder and file structure
&lt;/h2&gt;

&lt;p&gt;How my setup looks in the end and how I like to work with it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── app/
│   ├── assets/
│   ├──  js/
│   ├──  scss/
│        └── bootstrap/
│            └── _config.scss
│            └── _pre_defaults.scss
│        ├──  bootstrap_ext/
│            └── _button.scss
│        ├──  _variables.scss
│   ├──  index.scss
│   ├──  index.js/
│   ├── file22.ext
│   ├──  file23.ext

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Directory "scss"
&lt;/h3&gt;

&lt;p&gt;There shouldn't be SCSS files directly in this directory other than the &lt;code&gt;_variables.scss&lt;/code&gt;. I prefer to use the variables which are provided by Bootstrap. Only in cases there's nothing to be used from the Bootstrap core, I declare a custom variable in &lt;code&gt;_variables.scss&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Directory in "scss": Bootstrap
&lt;/h3&gt;

&lt;h4&gt;
  
  
  config.scss
&lt;/h4&gt;

&lt;p&gt;Bootstrap can be used very modular. I don't import the complete Bootstrap CSS. Instead I use &lt;code&gt;import&lt;/code&gt; in the &lt;code&gt;_config.scss&lt;/code&gt; to only get the components I want to use. In the end my CSS files only contains what I really need and use. Neat and clean - that's how I like it!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// READ MORE&lt;/span&gt;
&lt;span class="c1"&gt;// https://github.com/twbs/bootstrap&lt;/span&gt;
&lt;span class="c1"&gt;// https://get.getbootstrap.com&lt;/span&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"pre_default"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Core variables and mixins&lt;/span&gt;
&lt;span class="c1"&gt;// state in March 2018&lt;/span&gt;

&lt;span class="c1"&gt;// *** Core with grid&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"functions"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"variables"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"mixins"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"root"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"reboot"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"images"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"grid"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// *** Standards&lt;/span&gt;
&lt;span class="c1"&gt;// @import "tables";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "forms";&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"buttons"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// *** Components&lt;/span&gt;
&lt;span class="c1"&gt;// @import "transitions";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "dropdown";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "button-group";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "input-group";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "custom-forms";&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"nav"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"navbar"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// @import "card";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "breadcrumb";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "pagination";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "badge";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "jumbotron";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "alert";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "progress";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "media";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "list-group";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "close";&lt;/span&gt;

&lt;span class="c1"&gt;// *** Components w/ JavaScript&lt;/span&gt;
&lt;span class="c1"&gt;// @import "modal";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "tooltip";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "popover";&lt;/span&gt;
&lt;span class="c1"&gt;// @import "carousel";&lt;/span&gt;

&lt;span class="c1"&gt;// *** Utility classes&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/align"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/background"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/borders"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// @import "utilities/clearfix";&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/display"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// @import "utilities/embed";&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/flex"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// @import "utilities/float";&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/position"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/screenreaders"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/spacing"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/text"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"utilities/visibility"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// *** Print classes&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"print"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;span class="c1"&gt;// *** READ MORE&lt;/span&gt;
&lt;span class="c1"&gt;// https://github.com/twbs/bootstrap&lt;/span&gt;
&lt;span class="c1"&gt;// Based on Bootstrap v4.0.0&lt;/span&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"pre_default"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  pre_default.scss
&lt;/h4&gt;

&lt;p&gt;Bootstrap uses !default on each variable, which makes customizing very easy. It's the opposite of the notorious &lt;code&gt;!important&lt;/code&gt;: While &lt;code&gt;!important&lt;/code&gt; is like &lt;em&gt;"Oh, there's a rule for this? I don't care, use this!"&lt;/em&gt;, a variable with &lt;code&gt;!default&lt;/code&gt; will only get defined by SASS if it isn't already set.&lt;/p&gt;

&lt;p&gt;Take the variable &lt;code&gt;$enable-rounded: true !default;&lt;/code&gt; as example: It's set in Bootstrap and rounds all the corners. And if I don't want rounded corners?&lt;/p&gt;

&lt;p&gt;Simple: I write &lt;code&gt;$enable-rounded: false;&lt;/code&gt; in the &lt;code&gt;pre_default&lt;/code&gt; file. So when SASS is compiling the Bootstrap variables, $enable-rounded is already set and won't be touched. I didn't have to overwrite anything! Neat, huh?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Example for the use of pre_default&lt;/span&gt;

&lt;span class="nv"&gt;$enable-rounded&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Directory in SCSS
&lt;/h3&gt;

&lt;h4&gt;
  
  
  bootstrap_ext
&lt;/h4&gt;

&lt;p&gt;I customize and extend styles in Bootstrap in separate files, which are stored in a special folder. The file is named like the Bootstrap component I'm changing or extending.&lt;/p&gt;

&lt;p&gt;Suppose I want to change the border width for all buttons and add a class for dark buttons: I create a file &lt;code&gt;_button.scss&lt;/code&gt; - that's the name of the respective Bootstrap component - in the "bootstrap_ext" directory and adapt the style like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Example for overwriting and extending bootstrap components&lt;/span&gt;

&lt;span class="nc"&gt;.btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;$button-border-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nl"&gt;border-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$button-border-width&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;.btn-dark&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$black&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this structure it's easy to keep a clear overview where a style comes from and what Bootstrap component it extends or is based on.&lt;br&gt;
From here it's up to you how to create your structure. As example, in a pet project I worked on, I used this structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── css/
│   ├── bootstrap/
│   ├── bootstrap_ext/
│   ├── components/
│   ├── vendor/
│   ├── views/
│   ├── _variables.scss
│   ├── app.scss

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Directory "vendor"
&lt;/h3&gt;

&lt;p&gt;All vendor files are stored here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Directory "components"
&lt;/h3&gt;

&lt;p&gt;"components" contains custom SCSS components for this project, like "_calendar.scss".&lt;/p&gt;

&lt;h3&gt;
  
  
  Directory "views"
&lt;/h3&gt;

&lt;p&gt;In "views" I place styles which are not reusable and specific for a single view. I prefer to work in components, so there shouldn't be much in here.&lt;/p&gt;

&lt;p&gt;Tada.&lt;br&gt;
That's it! My basic SCSS setup with Bootstrap 4. :)&lt;/p&gt;

</description>
      <category>scss</category>
      <category>bootstrap4</category>
      <category>frontend</category>
      <category>css</category>
    </item>
    <item>
      <title>How frontend unit testing turned from a fling to a real thing for me</title>
      <dc:creator>Mirjam Aulbach</dc:creator>
      <pubDate>Fri, 28 Jun 2019 12:13:15 +0000</pubDate>
      <link>https://dev.to/programmiri/how-frontend-unit-testing-turned-from-a-fling-to-a-real-thing-for-me-6bk</link>
      <guid>https://dev.to/programmiri/how-frontend-unit-testing-turned-from-a-fling-to-a-real-thing-for-me-6bk</guid>
      <description>&lt;p&gt;&lt;em&gt;This article is originally from &lt;a href="https://medium.com/@programmiri/how-frontend-unit-testing-turned-from-a-fling-to-a-real-thing-for-me-36bf2844d3a0" rel="noopener noreferrer"&gt;Sep 21, 2017&lt;/a&gt;. I'm moving my content from medium to dev.to&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It’s hard to get around the word "&lt;a href="https://en.wikipedia.org/wiki/Software_testing" rel="noopener noreferrer"&gt;testing&lt;/a&gt;" if you’re on your way to become a professional programmer. Of course I read about it and even spend a few hours writing tests and solving artificial problems with test driven development. But I didn’t have the opportunity to apply my acquired knowledge in my day to day coding life. It just isn’t a thing at my job. We don’t write tests (yet, I want to change that) and so for a long time, all I knew about testing was more on an academic level.&lt;/p&gt;

&lt;h1&gt;
  
  
  How the fling started
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Pet projects to the rescue!
&lt;/h2&gt;

&lt;p&gt;I’m lucky to work on a few pet projects with experienced programmers. The most important thing I learn from my these projects are new or different workflows, best practices and patterns. In a project I’m currently working on I finally wrote real tests in a real environment. Hell, I had a lot of fun!&lt;/p&gt;

&lt;p&gt;By all means, I’m still a bloody beginner when it comes to unit testing. But now I finally saw and felt all the benefits I only read about before. And yeah, I fell in love a bit!&lt;/p&gt;

&lt;p&gt;Since a few days I’m working on a text about testing in the frontend with an example from said pet project. It helps me learn more about testing. At the same time I try to build a simple workflow to test my code for an non-testing environment, so I’ll be able to deliver more stable solutions. My new found feelings for testing are there, but I’m not really sure if and how they will work in my job.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real world catching up — TIFU
&lt;/h2&gt;

&lt;p&gt;Today, I received a bug ticket. For a simple Javascript feature I wrote a few months ago. I saw the description of the ticket, took one look into the code and I was furious at myself. I could see my error right away and it was a stupid one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;: The script should take an integer and give back a number formatted in the € currency format — a dot as thousands separator if needed and “Euro” at the end.&lt;/p&gt;

&lt;p&gt;That’s what my script looked like:&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sumNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sumFormatted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;sumNum&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;currNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sumNum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.&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="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currNum&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; Euro&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wrote this almost 4 months ago and really, I’m not proud. Nobody noticed the error for quite a time, because the function was used to format integers delivered by an API and — coincidentally — they all had &lt;em&gt;six digits&lt;/em&gt; for a while.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My first thought: &lt;em&gt;Damn, you’re stupid.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;My second thought: &lt;em&gt;Damn, you’re so f*** stupid, you only checked your script on the live site. You didn’t test your damn code properly!&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;My third thought: &lt;em&gt;Huh. You’re smarter now than back then.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Me and testing: Getting serious
&lt;/h2&gt;

&lt;p&gt;Here’s what I did to fix the bug: I wrote tests. I didn’t touch the script, I didn’t changed a single thing. I opened my editor and &lt;strong&gt;I. Wrote. The. F&lt;/strong&gt;&lt;em&gt;. Tests.&lt;/em&gt;*&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[SUCCESS] Is &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[ERROR] Expected &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;actual&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; to be &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;expected&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Test results&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1 Euro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;12 Euro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;123 Euro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1.234 Euro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;12.345 Euro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;123456&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;123.456 Euro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1234567&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1.234.567 Euro&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I ran the tests.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8epxtnuzpx8s0lndhkup.png"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;small&gt;I used an old grunt setup I did a while ago to practice TDD.&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The bug ticket reported a false format with a 5 digit number and the test reproduced this — &lt;code&gt;123.45 Euro&lt;/code&gt; instead of &lt;code&gt;12.345 Euro&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I corrected my script.&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;formatSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sumNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sumFormatted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

 &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;sumNum&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;currNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sumNum&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.&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="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currNum&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; Euro&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sumFormatted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I didn’t touch it otherwise. I didn’t refactor it, I didn’t make it better, I didn’t make it prettier — I just fixed my error.&lt;/p&gt;

&lt;p&gt;I ran my test again.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbk753wm6g3lfgwr27ic8.png"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;small&gt;Now that's a view I like!&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All done. I could push that change. It cost me about 10 minutes to curse me for a bit, write my tests and correct my script. That’s it! Now, there are tests for my function. I could refactor ist, write a new one — anything. While testing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I really like testing. We are, like, serious now!&lt;/li&gt;
&lt;li&gt;There are so damn many things I have to learn about testing and I’m really looking forward to it.&lt;/li&gt;
&lt;li&gt;I don’t have to wait for anyone or anything to write tests. Yeah, it would be best to work with a 100% code coverage and test allllll the things — but even one little test can improve my code and make me a better programer in the long run. And hey, I’m a perfectionist, I strive for improvement ;)&lt;/li&gt;
&lt;li&gt;Testing doesn’t have to be time consuming and therefor expensive! On the contrary: If I had written proper tests in the first place, the second bug ticket would never have happened.&lt;/li&gt;
&lt;li&gt;I write better code today than three months ago.&lt;/li&gt;
&lt;li&gt;Committing (sometimes even writing) code without tests feels a bit like driving without seatbelt now.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover Image: Photo by &lt;a href="https://unsplash.com/@ceryslowe_1?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Cerys Lowe&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>unittesting</category>
      <category>testing</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
