;;; tests/indent.el --- Some tests for js2-mode.
-;; Copyright (C) 2009, 2011-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2011-2016 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
s
(replace-regexp-in-string "^ *" "" s)))
(js2-jsx-mode)
+ (js2-reparse) ; solely for js2-jsx-self-closing, for some reason
(indent-region (point-min) (point-max))
(should (string= s (buffer-substring-no-properties
(point-min) (point)))))))
|}"
:bind ((js2-indent-switch-body t)))
+(js2-deftest-indent continued-expression-vs-unary-minus
+ "var arr = [
+ | -1, 2,
+ | -3, 4 +
+ | -5
+ |];")
+
+(js2-deftest-indent spread-inside-array
+ "var z = [
+ | ...iterableObj,
+ | 4,
+ | 5
+ |]")
+
(js2-deftest-indent jsx-one-line
"var foo = <div></div>;")