-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-fantasy-tests.sh
More file actions
executable file
·51 lines (42 loc) · 1.31 KB
/
run-fantasy-tests.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.31 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
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
# Script to run all fantasy points tests
# Print header
echo "========================================"
echo "Cricket Fantasy Points - Test Suite"
echo "========================================"
echo
# Function to run a test with proper output formatting
run_test() {
local test_name=$1
local command=$2
echo "Running test: $test_name"
echo "Command: $command"
echo "----------------------------------------"
# Run the command
if $command; then
echo -e "\n✅ Test passed: $test_name"
return 0
else
echo -e "\n❌ Test failed: $test_name"
return 1
fi
}
# Store the current directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Individual tests
echo "=== Individual Tests ==="
run_test "Calculate Points (Rohit Sharma)" "node $DIR/calculate-points.js"
echo
run_test "Full Scorecard Test" "node $DIR/full-test.js"
echo
run_test "Validation Test" "node $DIR/validate-fantasy-points.js"
echo
run_test "End-to-End Test" "node $DIR/end-to-end-test.js"
echo
# Integration test (runs all tests in sequence)
echo "=== Complete Integration Test ==="
run_test "Integration Test Suite" "node $DIR/integration-test.js"
echo
echo "========================================"
echo "Test Suite Execution Complete"
echo "========================================"