-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make this work for jasmine too #3
Comments
It should more or less work, but it might need some tweaks to command order. |
I'm inclined to wait until I someone tells me they actually need this. |
Looked at this more, jasmine takes all of its config via a json file which we already support via the command line options. The only real change needed is to change the |
I'm using (defcustom mocha-jest-command "node_modules/jest/bin/jest.js --colors"
"The path to the jest command to run."
:type 'string
:group 'mocha)
(defun mocha-generate-command--jest-command (debug &optional filename testname)
"Generate a command to run the test suite with jest.
If DEBUG is true, then make this a debug command.
If FILENAME is specified run just that file otherwise run
MOCHA-PROJECT-TEST-DIRECTORY.
IF TESTNAME is specified run jest with a pattern for just that test."
(let ((target (if testname (concat " --testNamePattern \"" testname "\"") ""))
(path (if (or filename mocha-project-test-directory)
(concat " --testPathPattern \"" (if filename filename mocha-project-test-directory) "\"")
""))
(node-command (concat mocha-which-node (if debug (concat " --debug=" mocha-debug-port) ""))))
(concat node-command " "
mocha-jest-command
target
path)))
(advice-add 'mocha-generate-command :override 'mocha-generate-command--jest-command) |
Noticed jest outputs a few random escape sequences that aren't caught by the current filter. Something like this clears them up for me.
|
@jojojames not working for me (using jest), is there any extra thing to do besides using that code? |
You need to combine the two posts above together. Here's a minimal use-package setup.
I don't know if the ansi escape sequences print properly on github. It's easy to run mocha and then copy the escape sequence yourself if you want to get rid of them. EDIT: Can try this link to copy the ansi sequences. |
@jojojames thank you very much, looks like a charm, it was characters not being displayed correctly on GH |
No description provided.
The text was updated successfully, but these errors were encountered: