glebbahmutov.com

Patching Cypress CLI NPM module

Note: this blog post is an expanded version of the official documentation section "Patch Cypress" available at https://on.cypress.io/debugging.If you discover a bug in an NPM module, you can open an issue and wait for a fix. Yet, sometimes the problem is quite small and waiting for a patch release seems like eternity. In this blog post I will show how to write a patch for Cypress NPM module yourself and apply it after installing the official NPM module. This allows you to avoid waiting for (sometimes delayed) official release.Cypress...

glebbahmutov.com

Climate Emergency

Informationread https://lizkeogh.com/2019/07/02/off-the-charts/sign up for https://www.nytimes.com/newsletters/climate-changewhy US bears responsibility for huge part of greenhouse emissions https://www.vox.com/energy-and-environment/2019/4/24/18512804/climate-change-united-states-china-emissionsHopeProject Drawdown is the world’s leading resource for climate solutions.https://www.macleans.ca/news/canada/yes-climate-change-can-be-beaten-by-2050-heres-how/PersonalHere is what I personally have done. This is something you should do too, and...

glebbahmutov.com

Capture all the logs

In this blog post I will show how to intercept messages logged by a Node process using a pre-loaded module. You can find the source code for these examples in bahmutov/capture-logs-example repository.Capture console logsImagine you want to collect all strings logged from a Node program. You could proxy all console.log calls and store them until needed. Take an example Node program like this one in index.js:index.js123console.log('this is %s log message ✅', 'console')console.warn('this is console %s ⚠️', 'warn')console.error('this is...

glebbahmutov.com

Run Cypress included from Docker container

In the blog post "Run Cypress with a single Docker command" I gave several examples running Cypress Docker image cypress/included using docker-compose command. I also showed how to run Cypress inside a Docker container, yet see it on the host machine. But I did not give an example of how to run Cypress inside a Docker container and test a web application running on the host machine.In this short blog post I will show how to do this. I am running Docker v18.09.2 on Mac.So imagine I have a local web application running on...