summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMunif Tanjim <hello@muniftanjim.dev>2022-02-26 19:59:48 +0600
committerStephan Seitz <stephan.seitz@fau.de>2022-02-26 15:44:11 +0100
commit20168d8e20ec8335fddba0f519f63f53db760d72 (patch)
tree47d78338c5c8ca4d5a53ae83834e30b8dea14563 /tests
parent1eaf0150c2f4483da0d4305cdbf43e1bc1da3814 (diff)
fix(indent): ecma - class method indentation
Diffstat (limited to 'tests')
-rw-r--r--tests/indent/ecma/class.js20
-rw-r--r--tests/indent/javascript_spec.lua14
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 00000000..e22cdef3
--- /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 98c46d8f..6af93c19 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 },