]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/fixers/test_prettier_eslint_fixer.callback.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / fixers / test_prettier_eslint_fixer.callback.vader
1 Before:
2   call ale#assert#SetUpFixerTest('javascript', 'prettier_eslint')
3   Save g:ale_command_wrapper
4
5   let g:ale_command_wrapper = ''
6
7 After:
8   call ale#assert#TearDownFixerTest()
9
10 Execute(The default command should be correct):
11   AssertFixer
12   \ {
13   \   'read_temporary_file': 1,
14   \   'command':
15   \     ale#Escape('prettier-eslint')
16   \     . ' %t'
17   \     . ' --write'
18   \ }
19
20 Execute(Additional options should be used when set):
21   let b:ale_javascript_prettier_eslint_options = '--foobar'
22
23   AssertFixer
24   \ {
25   \   'read_temporary_file': 1,
26   \   'command':
27   \     ale#Escape('prettier-eslint')
28   \     . ' %t'
29   \     . ' --foobar --write'
30   \ }
31
32 Execute(--eslint-config-path should be set for 4.2.0 and up):
33   call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
34
35   GivenCommandOutput ['4.2.0']
36   AssertFixer
37   \ {
38   \   'read_temporary_file': 1,
39   \   'command':
40   \     ale#Escape('prettier-eslint')
41   \     . ' %t'
42   \     . ' --eslint-config-path ' . ale#Escape(ale#test#GetFilename('../test-files/eslint/react-app/.eslintrc.js'))
43   \     . ' --write'
44   \ }
45
46 Execute(--eslint-config-path shouldn't be used for older versions):
47   call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
48
49   AssertFixer
50   \ {
51   \   'read_temporary_file': 1,
52   \   'command':
53   \     ale#Escape('prettier-eslint')
54   \     . ' %t'
55   \     . ' --write'
56   \ }
57
58 Execute(The version check should be correct):
59   AssertFixer [
60   \ ale#Escape('prettier-eslint') . ' --version',
61   \ {
62   \   'read_temporary_file': 1,
63   \   'command':
64   \     ale#Escape('prettier-eslint')
65   \     . ' %t'
66   \     . ' --write'
67   \ }
68   \]
69
70 Execute(The new --stdin-filepath option should be used when the version is new enough):
71   call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
72
73   GivenCommandOutput ['4.4.0']
74   AssertFixer
75   \ {
76   \   'cwd': '%s:h',
77   \   'command': ale#Escape('prettier-eslint')
78   \     . ' --eslint-config-path ' . ale#Escape(ale#test#GetFilename('../test-files/eslint/react-app/.eslintrc.js'))
79   \     . ' --stdin-filepath %s --stdin',
80   \ }
81
82 Execute(The version number should be cached):
83   GivenCommandOutput ['4.4.0']
84   AssertFixer
85   \ {
86   \   'cwd': '%s:h',
87   \   'command': ale#Escape('prettier-eslint')
88   \     . ' --stdin-filepath %s --stdin',
89   \ }
90
91   GivenCommandOutput []
92   AssertFixer
93   \ {
94   \   'cwd': '%s:h',
95   \   'command': ale#Escape('prettier-eslint')
96   \     . ' --stdin-filepath %s --stdin',
97   \ }