summaryrefslogtreecommitdiffstats
path: root/test/lazyintegration
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-05 20:49:32 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-06 19:34:32 +1000
commitabdd2455bb65a10540eb6eae49c87315f9103a1c (patch)
tree3035a1b8de5c687c99d5e18448c150b2ef3f17c3 /test/lazyintegration
parentc33f8d2790e757492a027568285568f5ebc505b1 (diff)
allow playing and updating snapshots
Diffstat (limited to 'test/lazyintegration')
-rw-r--r--test/lazyintegration/main.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/lazyintegration/main.go b/test/lazyintegration/main.go
index 19da5135e..a2d2f0abf 100644
--- a/test/lazyintegration/main.go
+++ b/test/lazyintegration/main.go
@@ -122,6 +122,20 @@ func main() {
log.Panicln(err)
}
+ if err := g.SetKeybinding("list", nil, 's', gocui.ModNone, func(*gocui.Gui, *gocui.View) error {
+ currentTest := app.getCurrentTest()
+ if currentTest == nil {
+ return nil
+ }
+
+ cmd := secureexec.Command("sh", "-c", fmt.Sprintf("UPDATE_SNAPSHOTS=true go run integration/main.go %s", currentTest.Name))
+ app.runSubprocess(cmd)
+
+ return nil
+ }); err != nil {
+ log.Panicln(err)
+ }
+
if err := g.SetKeybinding("list", nil, 'o', gocui.ModNone, func(*gocui.Gui, *gocui.View) error {
currentTest := app.getCurrentTest()
if currentTest == nil {
@@ -332,7 +346,7 @@ func (app *App) layout(g *gocui.Gui) error {
keybindingsView.Title = "Keybindings"
keybindingsView.Wrap = true
keybindingsView.FgColor = gocui.ColorDefault
- fmt.Fprintln(keybindingsView, "up/down: navigate, enter: run test, r: record test, o: open test config, n: duplicate test, m: rename test, d: delete test")
+ fmt.Fprintln(keybindingsView, "up/down: navigate, enter: run test, s: run test and update snapshots, r: record test, o: open test config, n: duplicate test, m: rename test, d: delete test")
}
editorView, err := g.SetViewBeneath("editor", "keybindings", editorViewHeight)