Skip to content

Commit

Permalink
enable running all tests when watching by pressing 'a'
Browse files Browse the repository at this point in the history
  • Loading branch information
dprotaso committed May 28, 2021
1 parent ecb7c69 commit 77279f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/filewatcher/term_unix.go
Expand Up @@ -80,6 +80,9 @@ func (r *redoHandler) Run(ctx context.Context) {
case 'd':
chResume = make(chan struct{})
r.ch <- RunOptions{Debug: true, resume: chResume}
case 'a':
chResume = make(chan struct{})
r.ch <- RunOptions{resume: chResume, PkgPath: "./..."}
case '\n':
fmt.Println()
continue
Expand Down
4 changes: 3 additions & 1 deletion internal/filewatcher/watch.go
Expand Up @@ -56,7 +56,9 @@ func Watch(dirs []string, run func(opts RunOptions) error) error {
resetTimer(timer)

redo.ResetTerm()
opts.PkgPath = h.lastPath
if opts.PkgPath == "" {
opts.PkgPath = h.lastPath
}
if err := h.runTests(opts); err != nil {
return fmt.Errorf("failed to rerun tests for %v: %v", opts.PkgPath, err)
}
Expand Down

0 comments on commit 77279f7

Please sign in to comment.