Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run javascript jest tests in a floaterm #391

Open
1 of 3 tasks
Danthewaann opened this issue Feb 6, 2023 · 0 comments
Open
1 of 3 tasks

Cannot run javascript jest tests in a floaterm #391

Danthewaann opened this issue Feb 6, 2023 · 0 comments

Comments

@Danthewaann
Copy link

Before reporting

  • Please make sure you have searched through the F.A.Q. first.

  • Please make sure you are using the latest version of this plugin.

  • It's better to use English as it's more friendly to other non-Chinese native users.

Environment

If you are using vim(not neovim), fill in the following blanks

  • Output of vim --version:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 10 2022 08:40:37)
Included patches: 1-749
Modified by [email protected]
Compiled by [email protected]
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       +tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
+balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
+browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   +toolbar
+cindent           +job               +popupwin          +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con_gui    +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            +X11
+digraphs          +mouse             +sound             -xfontset
+dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       +xpm
+emacs_tags        +mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
-farsi             -mouse_sysmouse    -tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -
I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/inclu
de/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/u
sr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gn
u/glib-2.0/include -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-cdpF6P/vim-9.0.0749=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wfor
mat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: gcc -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-obj
ects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2
.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lselinux -lcanberra -lsodium -lacl -lattr -lgpm -L/usr/lib -llua5.2 -Wl,-E -fstack-protec
tor-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.34/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python3.10/config-3.10-x86_64-linux-gnu -lpython3.10 -lcrypt 
-ldl -lm -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm -lruby-3.0 -lm -L/usr/lib 
  • Platform:

    • Linux
    • Mac OS X
    • Windows

If you are using neovim, just run :checkhealth floaterm and post the content

below.

Configurations related to vim-floaterm in vimrc(i.e. g:floaterm_xxx):

Describe your question, feature request, or bug.

Hi,

I currently using vim-test to try and run some javascript jest tests through a floaterm.
However when I attempt to run the nearest test to the cursor it fails to find the test.
The command that is being ran by vim-test is the following:

FloatermNew --autoclose=0 node_modules/.bin/jest --no-coverage --runTestsByPath -t '^When we call is HubAPIError\(\) Should return false for a default axios error response$' -- __tests__/errorHelpers-test.js

When I manually run the above jest command in a regular terminal, it successfully finds the test and runs it.

Steps to reproduce

Using the minimal vimrc

set nocompatible
set hidden
set termguicolors
set runtimepath^=/path/to/vim-floaterm
filetype plugin indent on
syntax on

Steps to reproduce the behavior:

  1. Install npm and nodejs
  2. Create a new javascript project with npm init (accept all the defaults as they don't matter here)
  3. Install jest with npm install jest
  4. Run mkdir __tests__
  5. Run the following in your terminal to create a dummy test
cat << EOF > __tests__/errorHelpers-test.js 
describe("When we call isHubAPIError()", () => {
    it("Should return false for a default axios error response", () => {
        expect(true).toEqual(true);
    });
});
EOF
  1. Run vim . to start up vim in your javascript project
  2. Finally run the following vim command to see the error described above:
FloatermNew --autoclose=0 node_modules/.bin/jest --no-coverage --runTestsByPath -t '^When we call is HubAPIError\(\) Should return false for a default axios error response$' -- __tests__/errorHelpers-test.js

Actual behaviour

The jest test is skipped as it seems to not match the regex, even though the same jest command works in a regular terminal.

Expected behaviour

The jest test should be found and run in a floaterm as expected.

Screenshots(Optional, GIF is better)

This a screenshot of the error that I'm getting:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant