   (mocha-run))
 
 ;;;###autoload
+(defun mocha-debug-project ()
+  "Debug the current project."
+  (interactive)
+  (mocha-debug))
+
+;;;###autoload
 (defun mocha-test-file ()
   "Test the current file."
   (interactive)
   (mocha-run (buffer-file-name)))
 
 ;;;###autoload
+(defun mocha-debug-file ()
+  "Debug the current file."
+  (interactive)
+  (mocha-debug (buffer-file-name)))
+
+;;;###autoload
 (defun mocha-test-at-point ()
   "Test the current innermost 'it' or 'describe' or the file if none is found."
   (interactive)

IF TEST is specified run mocha with a grep for just that test."
  (let ((path (or mocha-file mocha-project-test-directory))
        (target (if test (concat "--grep \"" test "\" ") ""))
        (node-command (concat mocha-which-node (if debug " --debug=5858" "")))
        (options (concat mocha-options (if debug " -t 21600000"))))
    (concat mocha-environment-variables " "
            node-command " "

  :type 'string
  :group 'mocha)

(defcustom mocha-debug-port "5858"
  "The port number to debug mocha tests at."
  :type 'string
  :group 'mocha)

(defvar mocha-project-test-directory nil)

(defvar node-error-regexp
