Skip to content

Instantly share code, notes, and snippets.

View tozwierz's full-sized avatar

Tomasz Zwierzchoń tozwierz

View GitHub Profile
@tozwierz
tozwierz / gist:76be651cc7a7d5c06ea290eec8a0ed73
Last active October 17, 2023 11:21
TDD: Socket.io + Jest Boilerplate
const io = require('socket.io-client');
const http = require('http');
const ioBack = require('socket.io');
let socket;
let httpServer;
let httpServerAddr;
let ioServer;
/**
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
# forked by Tomasz Zwierzchon
root_dir="$(git rev-parse --show-toplevel)"
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"