2024-03-02 07:05:47 +00:00
|
|
|
Before:
|
2024-06-21 00:21:19 +00:00
|
|
|
Save g:ale_biome_options
|
|
|
|
Save g:ale_biome_fixer_apply_unsafe
|
|
|
|
|
|
|
|
let g:ale_biome_options = ''
|
|
|
|
let g:ale_biome_fixer_apply_unsafe = 0
|
|
|
|
|
2024-03-02 07:05:47 +00:00
|
|
|
call ale#assert#SetUpFixerTest('typescript', 'biome')
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#assert#TearDownFixerTest()
|
|
|
|
|
|
|
|
Execute(The default biome command should be correct):
|
2024-06-27 05:30:06 +00:00
|
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
2024-03-02 07:05:47 +00:00
|
|
|
|
|
|
|
AssertFixer
|
|
|
|
\ {
|
2024-06-20 23:19:55 +00:00
|
|
|
\ 'read_temporary_file': 1,
|
2024-03-02 07:05:47 +00:00
|
|
|
\ 'command': ale#Escape('biome')
|
2024-06-21 00:21:19 +00:00
|
|
|
\ . ' check --apply %t'
|
2024-03-02 07:05:47 +00:00
|
|
|
\ }
|
|
|
|
|
2024-06-21 00:21:19 +00:00
|
|
|
Execute(Unsafe fixes can be applied via an option):
|
2024-06-27 05:30:06 +00:00
|
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
2024-06-21 00:21:19 +00:00
|
|
|
let g:ale_biome_fixer_apply_unsafe = 1
|
|
|
|
|
|
|
|
AssertFixer
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': ale#Escape('biome')
|
|
|
|
\ . ' check --apply-unsafe %t'
|
|
|
|
\ }
|
2024-06-27 05:30:06 +00:00
|
|
|
|
|
|
|
Execute(The fixer should accept options):
|
|
|
|
call ale#test#SetFilename('../test-files/biome/jsonc/src/test.ts')
|
|
|
|
let g:ale_biome_options = '--foobar'
|
|
|
|
|
|
|
|
AssertFixer
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': ale#Escape('biome')
|
|
|
|
\ . ' check --apply --foobar %t',
|
|
|
|
\ }
|