Skip to content

Commit

Permalink
tests(ts): use separate tests for omit_redundant_param_types setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Oct 27, 2023
1 parent 6b6c943 commit 17c0041
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions test/filetypes/typescript/class-properties.vader
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# ==============================================================================
# Functions with destructured parameters.
# Class with multiple properties
# ==============================================================================
Given typescript (class with multiple properties):
class TestClass {
foo
private bar;
baz: int
private bax: str = "test";
private bax2: str = "test";
}

Do (run doge):
Expand All @@ -19,10 +18,6 @@ Do (run doge):
\<C-d>
:17\<CR>
\<C-d>
:let g:doge_javascript_settings['omit_redundant_param_types'] = 1\<CR>
:22\<CR>
\<C-d>
:let g:doge_javascript_settings['omit_redundant_param_types'] = 0\<CR>

Expect typescript (each class prop has a docblock):
class TestClass {
Expand All @@ -46,8 +41,46 @@ Expect typescript (each class prop has a docblock):
* @type {str}
*/
private bax: str = "test";
}

# ------------------------------------------------------------------------------

Given typescript (class with multiple properties with omit_redundant_param_types=1):
class TestClass {
foo
private bar;
baz: int
private bax: str = "test";
}

Do (run doge):
:let g:doge_javascript_settings['omit_redundant_param_types'] = 1\<CR>
:2\<CR>
\<C-d>
:6\<CR>
\<C-d>
:10\<CR>
\<C-d>
:14\<CR>
\<C-d>
:let g:doge_javascript_settings['omit_redundant_param_types'] = 0\<CR>

Expect typescript (each class prop has a docblock):
class TestClass {
/**
* [TODO:description]
*/
foo
/**
* [TODO:description]
*/
private bax2: str = "test";
private bar;
/**
* [TODO:description]
*/
baz: int
/**
* [TODO:description]
*/
private bax: str = "test";
}

0 comments on commit 17c0041

Please sign in to comment.