Skip to content

Instantly share code, notes, and snippets.

View StackTrac3's full-sized avatar
๐Ÿ“ˆ

Justin StackTrac3

๐Ÿ“ˆ
View GitHub Profile
@StackTrac3
StackTrac3 / hard-dependency.js
Created January 29, 2021 10:26 — forked from ryyppy/hard-dependency.js
Jest: Module Mocking vs. Simple Dependency Injection
// ###############################
// runPackager.js
// ###############################
// In this example, the IO function is tightly coupled with the implementation
import { execFileSync } from 'child_process';
type RunPackagerOptions = {
projectRoot: string, // CWD the react-native binary is being run from
targetDir: string, // Target directory absolute or relative to projectRoot (e.g. 'rna/')