Skip to content

Commit

Permalink
Add file for jsdoc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailrun committed Oct 11, 2018
1 parent 32f5034 commit 5c9e46b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -3,6 +3,7 @@ ELS = \
typescript-mode.el \
typescript-mode-test-utilities.el \
typescript-mode-general-tests.el \
typescript-mode-jsdoc-tests.el \
typescript-mode-tests.el
ELCS = $(ELS:.el=.elc)

Expand Down
28 changes: 28 additions & 0 deletions typescript-mode-jsdoc-tests.el
@@ -0,0 +1,28 @@
;;; typescript-mode-jsdoc-tests --- This file contains JSDoc related tests for typescript-mode.el

;;; Commentary:
;; To understand the definition of JSDoc tag,
;; see https://github.com/jsdoc3/jsdoc/blob/b21427343c7294bbf1f14c718a390f3e955e37cb/lib/jsdoc/tag.js#L153-L195
;; To know how to run the tests, see typescript-mode-tests.el

;;; Code:

(require 'ert)
(require 'typescript-mode)
(require 'typescript-mode-test-utilities)

(defun jsdoc-multiline-test (jsdoc-lines specs)
""
(let* ((unwrapped-comment-lines
(mapcar (lambda (line) (concat " * " line "\n")) jsdoc-lines))
(comment-lines
(append '("/**\n") unwrapped-comment-lines '(" */"))))
(font-lock-test
(apply #'concat comment-lines)
(cons
'(1 . font-lock-comment-delimiter-face)
specs))))

(provide 'typescript-mode-jsdoc-tests)

;;; typescript-mode-jsdoc-tests.el ends here
2 changes: 1 addition & 1 deletion typescript-mode-tests.el
@@ -1,4 +1,3 @@

;;; typescript-mode-tests --- This file contains automated tests for typescript-mode.el

;;; Commentary:
Expand All @@ -11,6 +10,7 @@
(require 'cl)
(require 'typescript-mode-test-utilities)
(require 'typescript-mode-general-tests)
(require 'typescript-mode-jsdoc-tests)

(provide 'typescript-mode-tests)

Expand Down

0 comments on commit 5c9e46b

Please sign in to comment.