 ;; Disable completion keybindings, as we use xref-js2 instead
 (define-key tern-mode-keymap (kbd "M-.") nil)
 (define-key tern-mode-keymap (kbd "M-,") nil)
-
-;; Mocha
-(define-key js2-mode-map (kbd "C-c m p") 'mocha-test-project)
-(setq mocha-options "--timeout 15000 --exit")
 
 ;; Run npm test
 (defun npm-test ()

(add-to-list 'auto-mode-alist '("\\.es6\\'" . web-mode))

;; JS2 mode
(require 'js2-mode)
(require 'js2-refactor)
(require 'xref-js2)

(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))

(add-hook 'js2-mode-hook #'js2-refactor-mode)
(js2r-add-keybindings-with-prefix "C-c C-r")
(define-key js2-mode-map (kbd "C-k") #'js2r-kill)

(setq js2-highlight-level 3)

;; js-mode (which js2 is based on) binds "M-." which conflicts with xref, so
;; unbind it.


(add-hook 'js2-mode-hook (lambda ()
  (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t)))

(setq js2-highlight-level 3)

(require 'company)
(require 'company-tern)
