Code with Hugo: JS & Node.js in Prod logo

Code with Hugo: JS & Node.js in Prod

Subscribe
Archives
March 18, 2019

Create mock object instances in JavaScript using Object.defineProperty - Code with Hugo - Mar 18th 2019

Hot off the press

JavaScript Object.defineProperty for a function: create mock object instances in Jest or AVA - how to use Object.defineProperty with functions to mock method behaviour with simple objects.

If you missed it

Async JavaScript: history, patterns and gotchas. Also available as slides and runnable repo (at github.com/HugoDF/async-js-presentation)

A guide to Express request and response mocking/stubbing with Jest or sinon.

Pass cookies with axios or fetch requests: When sending requests from client-side JavaScript, by default cookies are not passed, here’s how to enable them in the axios module and using the fetch API.

Fix git “tip of your current branch is behind its remote counterpart”: explanation of why git rejects pushes and how to fix it under different scenarios and with different techniques.

Local HTTPS/SSL/TLS examples for Docker Compose github.com/HugoDF/docker-compose-local-https

Nuxt/Express/Postgres full-stack starter kit, you can check it out at github.com/HugoDF/nuxt-express-postgres-starter

From the web

mkcert: A simple zero-config tool to make locally trusted development certificates with any names you’d like.

Hetzner Cloud: “Truly thrifty cloud hosting”, Hetzner is renowned for its dedicated servers, this is their cloud offering, which is very competitive compared to DigitalOcean. A 2GB instance is €2.99/mo vs $10/mo and is also cheaper than the DigitalOcean 1GB instance at $5/mo.

A Tale of (prototype) Poisoning by Eran Hammer (creator of Hapi.js) describing an interesting security vulnerability encountered when using JSON.parse.

Don't miss what's next. Subscribe to Code with Hugo: JS & Node.js in Prod:
Powered by Buttondown, the easiest way to start and grow your newsletter.