Skip to content

Commit

Permalink
test(sync): restore tests passing locally
Browse files Browse the repository at this point in the history
  • Loading branch information
streambinder committed Sep 16, 2023
1 parent 3ad4b63 commit 06eed4c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/sync_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"context"
"errors"
"os"
"testing"
Expand Down Expand Up @@ -507,12 +506,10 @@ func TestCmdSyncCollectFailure(t *testing.T) {
ApplyFunc(provider.Search, func(*entity.Track) ([]*provider.Match, error) {
return []*provider.Match{{URL: "http://localhost/", Score: 0}}, nil
}).
ApplyFunc(routineCollectArtwork, func(*entity.Track) func(context.Context, chan error) {
return func(_ context.Context, ch chan error) {
ch <- errors.New("ko")
ApplyFunc(downloader.Download, func(url string, _ string, _ processor.Processor, ch ...chan []byte) error {
if url != "http://localhost/" {
return errors.New("ko")
}
}).
ApplyFunc(downloader.Download, func(_, _ string, _ processor.Processor, ch ...chan []byte) error {
for _, c := range ch {
c <- []byte{}
}
Expand Down

0 comments on commit 06eed4c

Please sign in to comment.