diff --git a/test/lsp-graphql-test.el b/test/lsp-graphql-test.el new file mode 100644 index 00000000000..f597fbf9a6d --- /dev/null +++ b/test/lsp-graphql-test.el @@ -0,0 +1,45 @@ +;;; lsp-graphql-test.el --- unit tests for lsp-graphql.el -*- lexical-binding: t -*- + +;; Copyright (C) 2024 ncaq + +;; Author: ncaq +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'ert) +(require 'lsp-graphql) + +(ert-deftest lsp-graphql-activate-p-based-on-file-extension () + (should (lsp-graphql-activate-p "abc.ts")) + (should (lsp-graphql-activate-p "abc.js")) + (should (lsp-graphql-activate-p "abc.jsx")) + (should (lsp-graphql-activate-p "abc.tsx")) + (should (lsp-graphql-activate-p "abc.vue")) + (should (lsp-graphql-activate-p "abc.graphql")) + (should (lsp-graphql-activate-p "abc.graphqls")) + (should (lsp-graphql-activate-p "abc.gql")) + (should-not (lsp-graphql-activate-p "abc.tsxx")) + (should-not (lsp-graphql-activate-p "abc.jss")) + (should-not (lsp-graphql-activate-p "abc.tsp")) + (should-not (lsp-graphql-activate-p "js.hs")) + (should-not (lsp-graphql-activate-p "/path/to/graphql/test.go"))) + +;;; lsp-graphql-test.el ends here