Skip to content

Commit bdd6fd4

Browse files
committed
add a test for error thrown if typescript-mode is loaded with lexical scoping enabled
1 parent 072f8ad commit bdd6fd4

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
;; -*- lexical-binding: t -*-
2+
;;; typescript-mode-lexical-binding-tests --- This file contains test for typescript-mode.el under enabled lexical-binding
3+
4+
;;; Commentary:
5+
;; To know how to run the tests, see typescript-mode-tests.el
6+
7+
(require 'ert)
8+
9+
;; reload typescript-mode with lexical-binding enabled
10+
(with-temp-buffer
11+
(insert-file-contents "typescript-mode.el")
12+
(ignore-errors
13+
(while (setq sexp (read (current-buffer)))
14+
(eval sexp t)
15+
))
16+
)
17+
18+
(require 'typescript-mode-test-utilities)
19+
20+
(ert-deftest lexical-binding--indentation-does-not-throw-error ()
21+
(with-temp-buffer
22+
(insert-file-contents "test-files/indentation-reference-document.ts")
23+
(typescript-mode)
24+
(goto-line 2)
25+
(typescript-indent-line)))
26+
27+
(provide 'typescript-mode-lexical-binding-tests)

typescript-mode-tests.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
(require 'typescript-mode-test-utilities)
1212
(require 'typescript-mode-general-tests)
1313
(require 'typescript-mode-jsdoc-tests)
14+
(require 'typescript-mode-lexical-binding-tests)
1415

1516
(provide 'typescript-mode-tests)
1617

0 commit comments

Comments
 (0)