Skip to content

Commit

Permalink
test: improve unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoliveira21 committed Dec 28, 2023
1 parent 10007e4 commit ca15c83
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 91 deletions.
13 changes: 12 additions & 1 deletion core/audio/audio_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
package audio_test

import (
"os"
"testing"

"github.com/gaoliveira21/chip8/core/audio"
)

func Test(t *testing.T) {
func TestNewAudioPlayer(t *testing.T) {
p, err := audio.NewAudioPlayer()

if p == nil {
t.Error(err)
}
}

func TestNewAudioPlayerWeb(t *testing.T) {
os.Setenv("EXEC_MODE", "web")

p, _ := audio.NewAudioPlayer()

if p != nil {
t.Error("Audio player expected to be nil")
}
}
Loading

0 comments on commit ca15c83

Please sign in to comment.