require 'spec_helper' describe "JSX" do let(:filename) { 'test.jsx' } def setup_filetype vim.set(:filetype, 'javascriptreact') vim.set(:expandtab) vim.set(:shiftwidth, 2) end after :each do vim.command('silent! unlet g:splitjoin_html_attributes_bracket_on_new_line') end describe "self-closing tags" do specify "basic" do set_file_contents '; EOF join assert_file_contents ';' setup_filetype vim.search 'Button' join remove_indentation assert_file_contents <<~EOF let button = ; EOF vim.search ' ; EOF join remove_indentation assert_file_contents '; } EOF setup_filetype vim.search ' ); } EOF vim.search('return \zs(') join assert_file_contents <<~EOF function button() { return ; } EOF end specify "tag with attributes in a lambda" do set_file_contents '() =>