Skip to content

Instantly share code, notes, and snippets.

mockComponent.js

This is designed as a simple React component mock to be used with Jest, that still presents enough information to be useful in a Snapshot test. It's handy when you either don't want to shallow render, or are unable to.

Usage

To use this mock, insert the following into your test file, to mock the sub-components, substituting out the names:

jest.mock("../MyComponent", () => ({ MyComponent: (props) => mockComponent("MyComponent", props) }));
@ba11b0y
ba11b0y / installing-postman.md
Last active August 31, 2023 19:21
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz