Open browser on startup automatically, with configuration option to disable.

This commit is contained in:
2022-05-01 11:55:20 +09:30
parent 0c2fafdc7a
commit 06ac259e0a
10 changed files with 57 additions and 12 deletions

View File

@@ -22,8 +22,8 @@ func TestNoConfig(t *testing.T) {
t.Errorf("unexpected failure from load: %s", err)
}
if c.Config.Version != 2 {
t.Error("not version 2 starting config")
if c.Config.Version != 3 {
t.Error("not version 3 starting config")
}
if fileSize(c.ConfigFilename) < 40 {
@@ -45,7 +45,7 @@ func TestEmptyFileConfig(t *testing.T) {
}
func TestMigrateFromV1toV2(t *testing.T) {
func TestMigrateFromV1toV3(t *testing.T) {
c := ConfigService{}
c.ConfigFilename = v1Config()
@@ -53,8 +53,12 @@ func TestMigrateFromV1toV2(t *testing.T) {
if err != nil {
t.Error("unexpected error from LoadOrInit()")
}
if c.Config.Version != 2 {
t.Errorf("Version %d not 2", c.Config.Version)
if c.Config.Version != 3 {
t.Errorf("Version %d not 3", c.Config.Version)
}
if c.Config.OpenBrowserOnStart != true {
t.Errorf("Open browser on start not true")
}
if len(c.Config.Watchers) != 1 {