Skip to content

Commit 3701231

Browse files
committed
Improve jsbeautify tests.
Prior to #96 (3dad76a and 8e54240), the js-beautify binary was invoked with the wrong --type argument. This change verifies the js-beautify arguments for each of the supported filetypes (so that we can verify the fixes above), and also explains what's wrong with the javascript filetype support (it's picked up by clang-format instead).
1 parent 295acb2 commit 3701231

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

vroom/jsbeautify.vroom

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,34 @@ You can format any buffer with js-beautify specifying the formatter explicitly.
5454
}
5555
@end
5656

57-
# @TODO: fix default formatter for javascript
5857
Several filetypes will use the js-beautify formatter by default:
5958
javascript, json, html and css.
6059

60+
Note that javascript will currently be picked up by clang-format;
61+
here we specify js-beautify explicitly.
62+
# @TODO: fix default formatter for javascript
63+
6164
@clear
6265
% f();
6366

67+
:set filetype=javascript
68+
:FormatCode js-beautify
69+
! js-beautify -f - --type js 2>.*
70+
$ f();
71+
6472
:set filetype=json
6573
:FormatCode
66-
! js-beautify .*
74+
! js-beautify -f - --type js 2>.*
6775
$ f();
6876

6977
:set filetype=html
7078
:FormatCode
71-
! js-beautify .*
79+
! js-beautify -f - --type html 2>.*
7280
$ f();
7381

7482
:set filetype=css
7583
:FormatCode
76-
! js-beautify .*
84+
! js-beautify -f - --type css 2>.*
7785
$ f();
7886

7987
:set filetype=

0 commit comments

Comments
 (0)