Docker:  Stop all containers now!

Docker: Stop all containers now!

Docker has changed our world. A very useful component in the toolbox of any Software Engineer or perhaps, any forward-thinking company. What is Docker? Why Docker? and other questions relating to the topic starts here: Docker

Sometimes, you are just too annoyed with the state of your machine and need to stop all running containers, here is a simple command:

#stop all running docker containers
docker stop $(docker ps -a -q)
#remove all docker containers
docker rm $(docker ps -a -q)

Unfortunately, that’s still not enough for the lazy engineer, simply add this as an alias in your bash/zsh profile and then you can call that command in a consistent and easy manner.

#!/usr/bin sh 
#I am either .bashrc or .zshrc or .bash_profile or whatever profile you use
alias docker_stop_all='docker stop $(docker ps -a -q)'
alias docker_remove_all='docker rm $(docker ps -a -q)'

Hope this helps.

Jest: Ignore CSS files while running tests

Jest: Ignore CSS files while running tests

To ensure Jest ignores CSS files when running tests, simply follow the steps below:

  1.  Install a module: `identity-obj-proxy`
npm install -D identity-obj-proxy

2.   Update your jest config(jest.config.json)

{
  "jest":{
     "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/__mocks__/fileMock.js",
      "\\.(css|less|scss|sass)$": "identity-obj-proxy"
    },
  }
}

Now run your tests again.   You should not see failures due to CSS files anymore.

Project Automation Guide

Test Automation Guide

Having worked in various environments where test automation is a constant part of the processes and in some cases migration from manual testing to automated testing taking place,  I am putting together a guide on how to introduce test automation as a reminder for myself and other testers or developer tester about to embark on such tasks.   Here’s a snapshot of what I will be covering:

  1. How to assess your current state of test automation readiness
  2. How to develop a plan that will optimize test automation, people and processes
  3. How a data-driven, scriptless test technology can benefit any sized organization
  4. How to develop and maintain high levels of regression testing needed, using dynamic automated methods
  5. How to leverage the best mix of tools and methods to accelerate success
  6. How to quantify the value of automation for your business