blob: b05f444b47dd0b48df8868088a25c64b757b1ad0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package utils
import (
"io/ioutil"
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/i18n"
"github.com/sirupsen/logrus"
)
// NewDummyLog creates a new dummy Log for testing
func NewDummyLog() *logrus.Entry {
log := logrus.New()
log.Out = ioutil.Discard
return log.WithField("test", "test")
}
func NewDummyCommon() *common.Common {
tr := i18n.EnglishTranslationSet()
newAppConfig := config.NewDummyAppConfig()
return &common.Common{
Log: NewDummyLog(),
Tr: &tr,
UserConfig: newAppConfig.GetUserConfig(),
}
}
|