typescript-ts-mode: Skip test if tsx grammar missing
authorMatthew Smith <matthew@gentoo.org>
Sat, 20 Jan 2024 09:45:31 +0000 (09:45 +0000)
committerYuan Fu <casouri@gmail.com>
Sun, 21 Jan 2024 05:10:51 +0000 (21:10 -0800)
typescript-ts-mode-test-indentation depends on both the tree-sitter
typescript grammar, and the tree-sitter tsx grammar.  If only the
typescript is installed, the tests will run and then fail unexpectedly
after tsx fails to load.

* test/lisp/progmodes/typescript-ts-mode-tests.el
(typescript-ts-mode-test-indentation): Skip test if tsx grammar is
missing.

Copyright-paperwork-exempt: yes

test/lisp/progmodes/typescript-ts-mode-tests.el

index 27b7df714e6a9fdaec98d09e4d9cae5da27bc3ce..effd9551fb0c1e8825c950e7bc8ba17830950901 100644 (file)
@@ -24,7 +24,8 @@
 (require 'treesit)
 
 (ert-deftest typescript-ts-mode-test-indentation ()
-  (skip-unless (treesit-ready-p 'typescript))
+  (skip-unless (and (treesit-ready-p 'typescript)
+                    (treesit-ready-p 'tsx)))
   (ert-test-erts-file (ert-resource-file "indent.erts")))
 
 (provide 'typescript-ts-mode-tests)