OLD | NEW |
---|---|
(Empty) | |
1 package frontend | |
2 | |
3 import ( | |
4 "bytes" | |
5 "io/ioutil" | |
6 "testing" | |
7 | |
8 . "github.com/smartystreets/goconvey/convey" | |
9 ) | |
10 | |
11 func TestWrapCallback(t *testing.T) { | |
12 t.Parallel() | |
13 | |
14 Convey("wrapCallback", t, func() { | |
15 expected := []byte(`foo({"hello":"world"});`) | |
16 result := wrapCallback( | |
17 bytes.NewReader([]byte(`{"hello":"world"}`)), | |
18 "foo", | |
19 ) | |
20 b, err := ioutil.ReadAll(result) | |
21 So(err, ShouldBeNil) | |
22 So(b, ShouldResemble, expected) | |
23 }) | |
24 } | |
OLD | NEW |