Run .NET and React tests efficiently. Use when asked to run tests, verify changes compile, investigate test failures, or validate code changes. Covers dotnet test, npm test, build verification, and failure investigation workflows.
Use this skill whenever running tests, verifying builds, or investigating test failures.
NEVER run the same test suite more than once per change cycle. Tests are expensive (3+ minutes for .NET, 12+ seconds for React). Always capture output to a log file on the first run, then use that log for all analysis.
cd /home/jpapiez/s/pfarm1/src
dotnet test ./farm-web.sln -c Debug 2>&1 | tee /tmp/dotnet-test-results.log
tee command displays output AND saves it simultaneously# Quick summary (pass/fail counts)
tail -30 /tmp/dotnet-test-results.log
# Find failures
grep -E "Failed|FAIL|Error" /tmp/dotnet-test-results.log
# Find specific test names that failed
grep -B2 "Failed" /tmp/dotnet-test-results.log
# Count totals
grep -E "Passed|Failed|Skipped" /tmp/dotnet-test-results.log | tail -5
cd /home/jpapiez/s/pfarm1/src
dotnet test ./farm-web.sln -c Debug --filter "FullyQualifiedName~TestClassName.TestMethodName" 2>&1 | tee /tmp/dotnet-test-single.log
cd /home/jpapiez/s/pfarm1/src/Web/ReactApp
npm run test:run 2>&1 | tee /tmp/react-test-results.log
test:run (non-interactive). NEVER use npm test which enters watch mode.# Quick summary
tail -20 /tmp/react-test-results.log
# Find failures
grep -E "FAIL|✗|×|Error" /tmp/react-test-results.log
# Find specific failing test files
grep "FAIL " /tmp/react-test-results.log
Always build before testing to catch compilation errors early:
# .NET
cd /home/jpapiez/s/pfarm1/src
dotnet build ./farm-web.sln -c Debug 2>&1 | tee /tmp/dotnet-build.log
# React (if needed)
cd /home/jpapiez/s/pfarm1/src/Web/ReactApp
npm run build 2>&1 | tee /tmp/react-build.log
tail -5 /tmp/dotnet-build.logThis is the full sequence. Each step runs ONCE:
cd /home/jpapiez/s/pfarm1/src && dotnet build ./farm-web.sln -c Debug 2>&1 | tee /tmp/dotnet-build.logtail -5 /tmp/dotnet-build.log — must show "succeeded"dotnet test ./farm-web.sln -c Debug --no-build 2>&1 | tee /tmp/dotnet-test-results.logtail -30 /tmp/dotnet-test-results.loggrep -B2 "Failed" /tmp/dotnet-test-results.log — investigate from the log, fix code, then re-run only step 1-4--filtertee or 2>&1 — you'll lose the output and have to re-runnpm test for automated testing — it enters watch mode and hangsdotnet test without building first (or use --no-build after a confirmed build)| Command | Typical Time | Minimum Timeout |
|---|---|---|
dotnet build -c Debug | ~82s | 150s |
dotnet test -c Debug | ~3m 30s | 240s |
dotnet test --no-build | ~3m | 240s |
dotnet test --filter "Name" | ~10-30s | 60s |
npm run test:run | ~12s | 60s |
npm run build | ~10s | 30s |
npm run lint | ~30s | 60s |