Skip to content

Instantly share code, notes, and snippets.

View dflor003's full-sized avatar

Danil Flores dflor003

View GitHub Profile
@dflor003
dflor003 / stub-of.jest.spec.ts
Created July 20, 2023 20:20
Jest auto-stub for classes
/* eslint-disable jest/expect-expect */
import { stubOf, Stub } from './stub-of';
describe('stubOf', () => {
describe('when stubbing classes', () => {
class MyClass {
field: string;
foo() {
return 'bar';
@dflor003
dflor003 / each
Last active July 12, 2016 13:37
Shell Script to run a command for each directory
#!/bin/bash -i
# Enable alias expansion
shopt -s expand_aliases
# Parse out file filter
fileFilter=""
if [[ "$#" -ge "3" && $1 = "-f" && -n "$2" ]]; then
fileFilter=$2
shift 2