File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717; ;;
1818
1919(defun jest-find-expected ()
20- (block find-fail-block
20+ (cl- block find-fail-block
2121 (let ((expected (condition-case nil
2222 (search-forward " Expected value" )
2323 (error nil ))))
3131(defun jest-find-fail ()
3232 ; ; Returns start end for actual and expected and position of fail o/w nil.
3333 (interactive )
34- (block find-fail-block
34+ (cl- block find-fail-block
3535 (let ((pos (condition-case nil
3636 (search-forward " ●" nil t )
3737 (error nil ))))
3838 (when (null pos)
39- (return-from find-fail-block nil ))
39+ (cl- return-from find-fail-block nil ))
4040 (let ((expected (jest-find-expected))
4141 (actual (condition-case nil
4242 (search-forward " Received:" )
4343 (error nil )))
4444 )
4545 (when (or (null actual) (null expected))
46- (return-from find-fail-block nil ))
46+ (cl- return-from find-fail-block nil ))
4747 (let* ((beg1 (progn
4848 (goto-char actual)
4949 (search-forward " \" " )
8888 (condition-case nil
8989 (search-forward " Summary of all failing tests" )
9090 (error (beginning-of-buffer )))
91- (do ((fail (jest-find-fail) (jest-find-fail)))
91+ (cl- do ((fail (jest-find-fail) (jest-find-fail)))
9292 ((null fail) nil )
9393 (print fail)
9494 (append-to-buffer bufferA (caadr fail) (cdadr fail))
102102; ;; Go to position where you want the next test inserted.
103103(defun jest-replace-expected-for-actual ()
104104 (interactive )
105- (block expected-block
105+ (cl- block expected-block
106106 (other-window 1 )
107107 (let* ((fail (jest-find-fail))
108108 (actual (car (fourth fail)))
You can’t perform that action at this time.
0 commit comments