Skip to content

Commit

Permalink
feat(tests): initialise tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Wabri committed Aug 8, 2024
1 parent 540886b commit bf1c699
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions constants/constants_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package constants
1 change: 1 addition & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package config
1 change: 1 addition & 0 deletions internal/dotfiles/init_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package dotfiles
24 changes: 24 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

import (
"os"
"testing"
)

// For fun
func Test_MainRunShouldExitOkWhenNoSubcommand(t *testing.T) {
_, w, _ := os.Pipe()
stdout := os.Stdout
stderr := os.Stderr

os.Stdout = w
os.Stderr = w

if mainRun() != exitOk {
t.Fatal("mainRun() not ok")
}

_ = w.Close()
os.Stdout = stdout
os.Stderr = stderr
}
1 change: 1 addition & 0 deletions pkg/cmd/checkhealth/checkhealth_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package checkhealth
1 change: 1 addition & 0 deletions pkg/cmd/init/init_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package init
1 change: 1 addition & 0 deletions pkg/cmd/root/root_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package root

0 comments on commit bf1c699

Please sign in to comment.