Skip to content

Instantly share code, notes, and snippets.

View prescottprue's full-sized avatar

Scott Prue prescottprue

View GitHub Profile
@prescottprue
prescottprue / jest-to-vitest.sh
Last active February 2, 2026 23:06
Replace Jest With Vitest
#!/bin/bash
# Based off https://gist.github.com/wojtekmaj/6defa1f358daae28bd52b7b6dbeb7ab6 with a few fixes and
# additions/removals including no git interactions
join_by() {
local d=${1-} f=${2-}
if shift 2; then
printf %s "$f" "${@/#/$d}"
fi
@prescottprue
prescottprue / import-resolution-mode.ts
Last active November 14, 2024 01:34
Google Cloud Storage ESM/CJS Type Mismatch
import type { Storage, File } from '@google-cloud/storage' with { "resolution-mode": "import" }
async function someFunc(): Promise<File> {
const { Storage } = await import('@google-cloud/storage')
const storage = new Storage() // <- is ESM types, not CSJ
return storage.bucket(bucket).file(filePath) // not the same as File type
}