#!/usr/bin/env bash
set -euo pipefail

root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"

if [ -f "$root/services/core/go.mod" ]; then
  (cd "$root/services/core" && go test ./...)
fi

if [ -f "$root/apps/web/package.json" ]; then
  (cd "$root/apps/web" && npm test -- --run)
fi

if [ -f "$root/apps/mobile/pubspec.yaml" ]; then
  (cd "$root/apps/mobile" && flutter test)
fi
