tests(bats): minor improvement to test generation.
This commit is contained in:
parent
7e09351f8f
commit
d6d4648106
2 changed files with 19 additions and 10 deletions
|
|
@ -40,7 +40,7 @@ type Config struct {
|
|||
TldrDir *paths.Path // Default: tests/tldr
|
||||
TldrFile *paths.Path // Default: tests/tldr.yml
|
||||
TestsFile *paths.Path // Default: tests/tests.yml
|
||||
BatsDir *paths.Path // Default: tests/bats
|
||||
BatsDir *paths.Path // Default: tests/bats_dirty
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
|
|
@ -70,6 +70,12 @@ func run() error {
|
|||
}
|
||||
tests = tests.Filter()
|
||||
|
||||
if err := cfg.BatsDir.RemoveAll(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := cfg.BatsDir.MkdirAll(); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, test := range tests {
|
||||
if err := test.Write(cfg.BatsDir); err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue