diff options
| author | Munif Tanjim <hello@muniftanjim.dev> | 2022-02-26 19:59:48 +0600 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-26 15:44:11 +0100 |
| commit | 20168d8e20ec8335fddba0f519f63f53db760d72 (patch) | |
| tree | 47d78338c5c8ca4d5a53ae83834e30b8dea14563 /tests | |
| parent | Update lockfile.json (diff) | |
| download | nvim-treesitter-20168d8e20ec8335fddba0f519f63f53db760d72.tar nvim-treesitter-20168d8e20ec8335fddba0f519f63f53db760d72.tar.gz nvim-treesitter-20168d8e20ec8335fddba0f519f63f53db760d72.tar.bz2 nvim-treesitter-20168d8e20ec8335fddba0f519f63f53db760d72.tar.lz nvim-treesitter-20168d8e20ec8335fddba0f519f63f53db760d72.tar.xz nvim-treesitter-20168d8e20ec8335fddba0f519f63f53db760d72.tar.zst nvim-treesitter-20168d8e20ec8335fddba0f519f63f53db760d72.zip | |
fix(indent): ecma - class method indentation
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/indent/ecma/class.js | 20 | ||||
| -rw-r--r-- | tests/indent/javascript_spec.lua | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/indent/ecma/class.js b/tests/indent/ecma/class.js new file mode 100644 index 000000000..e22cdef36 --- /dev/null +++ b/tests/indent/ecma/class.js @@ -0,0 +1,20 @@ +class IndentTest { + async isEqual(paramOne, paramTwo) { + if (paramOne === paramTwo) { + return true + } + + return false + } + + async isNotEqual( + paramOne, + paramTwo, + ) { + if (paramOne !== paramTwo) { + return true + } + + return false + } +} diff --git a/tests/indent/javascript_spec.lua b/tests/indent/javascript_spec.lua index 98c46d8ff..6af93c190 100644 --- a/tests/indent/javascript_spec.lua +++ b/tests/indent/javascript_spec.lua @@ -38,6 +38,20 @@ describe("indent JavaScript:", function() for _, info in ipairs { + { 1, 2 }, + { 2, 4 }, + { 3, 6 }, + { 5, 4 }, + { 8, 2 }, + { 11, 4 }, + { 13, 4 }, + } + do + run:new_line("ecma/class.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4]) + end + + for _, info in + ipairs { { 2, 2 }, { 5, 2 }, { 7, 0 }, |
