|
| 1 | +;;; lsp-graphql-test.el --- unit tests for lsp-graphql.el -*- lexical-binding: t -*- |
| 2 | + |
| 3 | +;; Copyright (C) 2024 ncaq <ncaq@ncaq.net> |
| 4 | + |
| 5 | +;; Author: ncaq <ncaq@ncaq.net> |
| 6 | +;; Keywords: |
| 7 | + |
| 8 | +;; This program is free software; you can redistribute it and/or modify |
| 9 | +;; it under the terms of the GNU General Public License as published by |
| 10 | +;; the Free Software Foundation, either version 3 of the License, or |
| 11 | +;; (at your option) any later version. |
| 12 | + |
| 13 | +;; This program is distributed in the hope that it will be useful, |
| 14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | +;; GNU General Public License for more details. |
| 17 | + |
| 18 | +;; You should have received a copy of the GNU General Public License |
| 19 | +;; along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | + |
| 21 | +;;; Commentary: |
| 22 | + |
| 23 | +;; |
| 24 | + |
| 25 | +;;; Code: |
| 26 | + |
| 27 | +(require 'ert) |
| 28 | +(require 'lsp-graphql) |
| 29 | + |
| 30 | +(ert-deftest lsp-graphql-activate-p-based-on-file-extension () |
| 31 | + (should (lsp-graphql-activate-p "abc.ts")) |
| 32 | + (should (lsp-graphql-activate-p "abc.js")) |
| 33 | + (should (lsp-graphql-activate-p "abc.jsx")) |
| 34 | + (should (lsp-graphql-activate-p "abc.tsx")) |
| 35 | + (should (lsp-graphql-activate-p "abc.vue")) |
| 36 | + (should (lsp-graphql-activate-p "abc.graphql")) |
| 37 | + (should (lsp-graphql-activate-p "abc.graphqls")) |
| 38 | + (should (lsp-graphql-activate-p "abc.gql")) |
| 39 | + (should-not (lsp-graphql-activate-p "abc.tsxx")) |
| 40 | + (should-not (lsp-graphql-activate-p "abc.jss")) |
| 41 | + (should-not (lsp-graphql-activate-p "abc.tsp")) |
| 42 | + (should-not (lsp-graphql-activate-p "js.hs")) |
| 43 | + (should-not (lsp-graphql-activate-p "/path/to/graphql/test.go"))) |
| 44 | + |
| 45 | +;;; lsp-graphql-test.el ends here |
0 commit comments