forked from ag-grid/ag-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbehave.sh
More file actions
executable file
·41 lines (36 loc) · 1.34 KB
/
behave.sh
File metadata and controls
executable file
·41 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Runs behavioural tests directly via Vitest, bypassing Nx.
# All arguments are forwarded to vitest. Watch mode is disabled by default.
#
# Usage:
# ./behave.sh # Run all tests
# ./behave.sh "file-pattern" # Run tests matching pattern
# ./behave.sh "file-pattern" -t "name" # Run specific test by name
# ./behave.sh -w # Run in watch mode
# ./behave.sh --watch # Run in watch mode
# ./behave.sh --update # Update vitest snapshots
# ./behave.sh --update-grid-rows # Update GridRows inline snapshots
# ./behave.sh --update-grid-rows=dry # Dry-run: show what would change
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Parse --update-grid-rows flag
args=()
for arg in "$@"; do
case "$arg" in
--update-grid-rows)
export UPDATE_GRID_ROWS_SNAPSHOTS=1
;;
--update-grid-rows=dry)
export UPDATE_GRID_ROWS_SNAPSHOTS=dry
;;
--update-grid-rows=*)
echo "Unknown value: $arg (expected --update-grid-rows or --update-grid-rows=dry)" >&2
exit 1
;;
*)
args+=("$arg")
;;
esac
done
cd "$SCRIPT_DIR/testing/behavioural"
exec npx vitest "${args[@]+"${args[@]}"}"