-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.bat
More file actions
38 lines (31 loc) · 1 KB
/
run_tests.bat
File metadata and controls
38 lines (31 loc) · 1 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
@echo off
setlocal
set LOGFILE=project_logs.log
echo Running lint and unit tests, capturing output to %LOGFILE%...
echo ======================================== > %LOGFILE%
echo Test run started: %DATE% %TIME% >> %LOGFILE%
echo ======================================== >> %LOGFILE%
echo. >> %LOGFILE%
echo [1/2] Running ESLint...
call npm run lint >> %LOGFILE% 2>&1
set LINT_EXIT=%ERRORLEVEL%
echo [2/2] Running unit tests...
call npm run test:unit >> %LOGFILE% 2>&1
set TEST_EXIT=%ERRORLEVEL%
echo. >> %LOGFILE%
echo ======================================== >> %LOGFILE%
echo Test run completed: %DATE% %TIME% >> %LOGFILE%
echo Lint exit code: %LINT_EXIT% >> %LOGFILE%
echo Unit tests exit code: %TEST_EXIT% >> %LOGFILE%
echo ======================================== >> %LOGFILE%
if %LINT_EXIT% neq 0 (
echo Lint failed with exit code %LINT_EXIT%
exit /b %LINT_EXIT%
)
if %TEST_EXIT% neq 0 (
echo Unit tests failed with exit code %TEST_EXIT%
exit /b %TEST_EXIT%
)
echo All tests passed
endlocal
exit /b 0