Markus Oberlehner

Blog Page 22

Exploratory TDD

I'm currently working hard on making TDD my default way of writing code. Although I have noticed that the more I practice TDD, the easier it becomes, I still often fall back on writing dozens of lines of code without running tests that cover them...

Testing Vuex Powered Vue.js Components with Jest

Thanks to the vue-test-utils, testing Vue components has become much more comfortable. But things can get a little more complicated if you add Vuex to the equation...

Git, the pedantic way

When people think of programmers, they think of pale nerds sitting in front of their computers writing code all day long. As we all know, this couldn't be further from the truth. In reality, we're pale nerds, who spend most of our time sitting in front of our computers reading (and trying to make sense of code), written by other people (or our past selves)...

Speeding up Nightwatch.js Powered Acceptance Tests

Today we will examine two ways how we can speed up the testing process with Nightwatch.js – because faster is always better. The first small speed improvement can be achieved by eliminating Selenium from the setup...

Intelligent Design vs. Evolution

In the last few days I have been confronted with the results of planning mistakes in several (personal and professional) projects on which I work. It's an unpleasant feeling to have to refactor large parts of the architecture of a project because you've come to realize that what initially looked like a good idea doesn't work the way you imagined it would...

Two-Tier Sass Variables / CSS Custom Properties

One of the hardest challenges when working with CSS (or Sass) at scale, is to keep everything consistent and maintainable. Sass variables or CSS custom properties can be a handy tool to help with consistency and flexibility. Variables can make your life as a developer a lot easier. But there are many considerations you have to keep in mind when defining variables for your CSS framework...

The Ultimative Flexbox Based CSS Layout

Things are looking good on the CSS layout front. Flexbox can be used in all major browsers and CSS Grid Layout is almost at a point where browser support has reached a sweet spot – for some of us it might even be feasible to build production websites using CSS Grid Layout and some form of graceful fallback. Until the rest of us can finally switch to CSS Grid Layout, we have to rely solely on Flexbox to satisfy all our layout needs. But that's not a bad thing at all, Flexbox is pretty powerful by itself already...

Unit Testing Vue.js Single File Components with ava

Testing Vue.js components is different from testing regular JavaScript modules or classes in two ways. First of all Vue.js components depend on Vue.js, its global state and oftentimes on plugins like Vuex or the vue-router. Second, Vue.js single file components usually are compiled with webpack, the regular workflow of using Babel to compile JavaScript code before testing it, is not sufficient in this case. Let's find out how to deal with those challenges...

Acceptance Testing with Nightwatch.js and Cucumber.js Part 2: Smart Step Definitions

In an ideal world, it should be possible to write basic acceptance test specifications without having to add any new step definitions. In the real world this is not always possible, because some features, with some very specific functionality, might need special treatment and are impossible to test without writing custom step definitions...