Just verify that the calls to the channel() fn show up in the output channel list.
(t *testing.T)
| 61 | |
| 62 | // Just verify that the calls to the channel() fn show up in the output channel list. |
| 63 | func TestSyncFunction(t *testing.T) { |
| 64 | ctx := base.TestCtx(t) |
| 65 | mapper := NewChannelMapper(ctx, `function(doc) {channel("foo", "bar"); channel("baz")}`, 0) |
| 66 | res, err := mapper.MapToChannelsAndAccess(ctx, parse(t, `{"channels": []}`), `{}`, emptyMetaMap(), noUser) |
| 67 | assert.NoError(t, err, "MapToChannelsAndAccess failed") |
| 68 | assert.Equal(t, BaseSetOf(t, "foo", "bar", "baz"), res.Channels) |
| 69 | } |
| 70 | |
| 71 | // Just verify that the calls to the access() fn show up in the output channel list. |
| 72 | func TestAccessFunction(t *testing.T) { |
nothing calls this directly
no test coverage detected