Skip to content

Instantly share code, notes, and snippets.

View toni-sharpe's full-sized avatar

Toni Leigh Sharpe toni-sharpe

View GitHub Profile
@toni-sharpe
toni-sharpe / jest-mock-eg.js
Created July 5, 2019 07:09
Jest Mock Module Example
// Path to the module to mock
// Then function which is called when the module is accessed
jest.mock("../mocked-module", () => ({
// Allows for multiple exports and a default to be mocked out individually
__esModule: true,
// Immediately returning the args like this is a substitute for inspecting the calledWith
// on a mock (Jest mock does not allow access to surrounding variables like a closure would)
default: jest.fn(args => args),
API_METHOD: { POST: "POST" }
}));
@toni-sharpe
toni-sharpe / linux-teardown.sh
Last active May 3, 2018 12:41
linux-teardown.sh
# curl -fsSL <url_for_raw_version_of_this_gist> | bash
# ensure you're in the root
cd ~
# Back up the notes , sublime-projects and ui-snippets folders
cp -r ~/notes /media/psf/Home/dev/parallels
cp -r ~/sublime-projects /media/psf/Home/dev/parallels
cp -r ~/ui-snippets /media/psf/Home/dev/parallels