qmd/qmd
Tobi Lutke 9b89a51d10
test: split integration/model suites
Split test suites for explicit runtime execution.

- Move model-related tests under `src/models/*`.
- Move CLI/integration tests under `src/integration/*`.
- Add `src/store.helpers.unit.test.ts` for helper unit coverage.
- Add shared Vitest config with default timeout and suite organization.
- Remove legacy flat test files from `src/` root.
- Keep core test commands in scripts supporting unit/models/integration runs.
2026-02-15 16:57:13 -04:00

47 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# qmd - Quick Markdown Search
set -euo pipefail
# Find node - prefer PATH, fallback to known locations
find_node() {
if command -v node &>/dev/null; then
local ver=$(node --version 2>/dev/null | sed 's/^v//' || echo "0")
local major="${ver%%.*}"
if [[ "$major" -ge 22 ]]; then
command -v node
return 0
fi
fi
# Fallback: derive paths (need HOME)
: "${HOME:=$(eval echo ~)}"
# Check known locations
local candidates=(
"$HOME/.local/share/mise/installs/node/latest/bin/node"
"$HOME/.local/share/mise/shims/node"
"$HOME/.asdf/shims/node"
"/opt/homebrew/bin/node"
"/usr/local/bin/node"
"$HOME/.nvm/current/bin/node"
)
for c in "${candidates[@]}"; do
[[ -x "$c" ]] && { echo "$c"; return 0; }
done
return 1
}
NODE=$(find_node) || { echo "Error: node (>=22) not found. Install from https://nodejs.org" >&2; exit 1; }
# Resolve symlinks to find script location
SOURCE="${BASH_SOURCE[0]}"
while [[ -L "$SOURCE" ]]; do
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
exec "$NODE" --import tsx "$SCRIPT_DIR/src/qmd.ts" "$@"