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

Code with Hugo: JS & Node.js in Prod

Subscribe
Archives
November 12, 2019

Jest Mock Set, Reset and Clear - Code with Hugo - Nov 12th 2019

Hot off the press

Jest set, clear and reset mock/spy/stub implementation: Between test runs we need mocked/spied on imports and functions to be reset so that assertions don’t fail due to stale calls (from a previous test).

If you missed it

Tailwind CSS 1.x impressions, development and production setup for static sites with Tailwind CLI and PurgeCSS CLI: Tailwind CSS is “a utility-first CSS framework for rapidly building custom designs”.

Super-powered newsletter content with Pocket and Netlify Lambda: An example Netlify Lambda to fetch all “newsletter” posts from Pocket.

Jest .fn() and .spyOn() spy/stub/mock assertion reference: Where other JavaScript testing libraries would lean on a specific stub/spy library like Sinon - Standalone test spies, stubs and mocks for JavaScript.

From the web

Postgres Handles More Than You Think by Jason Skowronski: Key Takeaways Thinking about adding another data store like Redis or Elasticsearch? Take a minute and think again. Postgres offers powerful features which are not obvious at first sight. Postgres has an in-memory caching system with pages, usage counts, and transaction logs.

Processing 40 TB of code from ~10 million projects with a dedicated server: Ben E. C. Boyter's Blog The command line tool I created Sloc Cloc and Code (scc) (which is now modified and maintained by many other excellent people) counts lines of code, comments and makes a complexity estimate for files inside a directory.

My Time at Snap by Marko Tupper: I spent the last year and a half working as a software engineer for Snap, Inc.. The experience was…unique, if nothing else.

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.