rcarriga / vim-ultest

The ultimate testing plugin for (Neo)Vim
MIT License
383 stars 15 forks source link

Runner stuck with CreateReactApp #59

Closed MasterGordon closed 3 years ago

MasterGordon commented 3 years ago

Describe the bug The testrunner gets stuck when running the tests

Please include language and test runner being used. typescript with the default create-react-app template. The test will be run with react-scripts test

Logs should be created using ULTEST_LOG_LEVEL=DEBUG ULTEST_LOG_FILE=vim-ultest.log nvim <test-file> and added here as well 20:07:35 | INFO | MainThread | logging.py:create_logger:101 | Logger created 20:07:36 | DEBUG | MainThread | init.py:init:43 | Handler created 20:07:36 | DEBUG | Thread-1 | init.py:_handle_coroutine:58 | Starting job with group update_positions 20:07:36 | INFO | Thread-1 | tracker.py:_async_update:55 | Updating positions in src/App.test.tsx 20:07:36 | DEBUG | Thread-1 | file.py:parse_file_structure:25 | Converted pattern {'test': ['\v^\s%(it|test)\s[( ]\s%("|\'|`)(.)%("|\'|)'], 'namespace': ['\\v^\\s*%(describe|suite|context)\\s*[( ]\\s*%("|\'|)(.)%("|\'|`)']} to {'test': [re.compile('^\s(?:it|test)\s[( ]\s(?:"|\'|)(.*)(?:"|\'|)')], 'namespace': [re.compile('^\s(?:describe|suite|context)\s[( ]\s(?:"|\'|`)(.)(?:"|\'|)')]} 20:07:36 | DEBUG | Thread-1 | tracker.py:_async_update:82 | New test src/App.test.tsx found in src/App.test.tsx 20:07:36 | DEBUG | Thread-1 | tracker.py:_async_update:82 | New test renders_learn_react_link4787548909642993506 found in src/App.test.tsx 20:07:36 | DEBUG | Thread-1 | tracker.py:_remove_old_positions:125 | No tests removed 20:07:36 | DEBUG | Thread-1 | __init__.py:_handle_coroutine:78 | Finished job with group update_positions 20:07:49 | INFO | MainThread | __init__.py:run_nearest:125 | Running nearest test in src/App.test.tsx at line 1 20:07:49 | DEBUG | MainThread | __init__.py:_register_started:281 | Registering renders_learn_react_link4787548909642993506 as started 20:07:49 | DEBUG | Thread-1 | __init__.py:_handle_coroutine:58 | Starting job with group renders_learn_react_link4787548909642993506 20:07:49 | DEBUG | Thread-1 | processes.py:run:50 | Starting test process renders_learn_react_link4787548909642993506 with command ['node_modules/.bin/react-scripts', 'test', '-t', 'renders learn react link$', 'src/App.test.tsx'], cwd = None, env = None 20:12:02 | INFO | MainThread | logging.py:create_logger:101 | Logger created 20:12:02 | DEBUG | MainThread | __init__.py:__init__:43 | Handler created 20:12:02 | DEBUG | Thread-1 | __init__.py:_handle_coroutine:58 | Starting job with group update_positions 20:12:02 | INFO | Thread-1 | tracker.py:_async_update:55 | Updating positions in src/App.test.tsx 20:12:02 | DEBUG | Thread-1 | file.py:parse_file_structure:25 | Converted pattern {'test': ['\\v^\\s*%(it|test)\\s*[( ]\\s*%("|\'|)(.)%("|\'|`)'], 'namespace': ['\v^\s%(describe|suite|context)\s[( ]\s%("|\'|)(.*)%("|\'|)']} to {'test': [re.compile('^\s(?:it|test)\s[( ]\s(?:"|\'|`)(.)(?:"|\'|)')], 'namespace': [re.compile('^\\s*(?:describe|suite|context)\\s*[( ]\\s*(?:"|\'|)(.*)(?:"|\'|`)')]} 20:12:02 | DEBUG | Thread-1 | tracker.py:_async_update:82 | New test src/App.test.tsx found in src/App.test.tsx 20:12:02 | DEBUG | Thread-1 | tracker.py:_async_update:82 | New test renders_learn_react_link1151337496413743625 found in src/App.test.tsx 20:12:02 | DEBUG | Thread-1 | tracker.py:_remove_old_positions:125 | No tests removed 20:12:02 | DEBUG | Thread-1 | init.py:_handle_coroutine:78 | Finished job with group update_positions 20:12:12 | INFO | MainThread | init.py:run_nearest:125 | Running nearest test in src/App.test.tsx at line 1 20:12:12 | DEBUG | MainThread | init.py:_register_started:281 | Registering renders_learn_react_link1151337496413743625 as started 20:12:12 | DEBUG | Thread-1 | init.py:_handle_coroutine:58 | Starting job with group renders_learn_react_link1151337496413743625 20:12:12 | DEBUG | Thread-1 | processes.py:run:50 | Starting test process renders_learn_react_link1151337496413743625 with command ['node_modules/.bin/react-scripts', 'test', '-t', 'renders learn react link$', 'src/App.test.tsx'], cwd = None, env = None

To Reproduce Steps to reproduce the behavior: npx create-react-app reproduction-example --template typescript cd reproduction-example npm install nvim src/App.test.tsx :UltestNearest

Expected behavior Running the test

Screenshots If applicable, add screenshots to help explain your problem.

Additional context If I run the command from the log output my self it runs in an interactive way, I think this might be the issue image node_modules/.bin/react-scripts test -t 'renders learn react link' src/App.test.tsx If you set the env variable CI=true it is no longer interactive and just prints the result: image

MasterGordon commented 3 years ago

If I run CI=true nvim src/App.test.tsx it just works fine so I guess react-scripts just allways needs CI=true

rcarriga commented 3 years ago

This is the same issue as #54. You can supply an argument to the test runner to not run in watch mode

let test#javascript#reactscripts#options = "--watchAll=false"
MasterGordon commented 3 years ago

Thanks for your fast reply! It would be nice to have this settings documented or even have them set by default.