Skip to content

Commit 31b37a9

Browse files
committed
test: cover read-only feeds field
1 parent cf19d29 commit 31b37a9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ describe('ChainlinkDataStreamsConsumer', function () {
292292
const client = new ChainlinkDataStreamsConsumer(config);
293293
delete client.apiUrl
294294
assert.rejects(()=>{client.fetch()})
295-
})
295+
});
296296

297297
it("can't subscribe to feeds without wsUrl", function () {
298298
assert.doesNotThrow(() => {
@@ -301,7 +301,14 @@ describe('ChainlinkDataStreamsConsumer', function () {
301301
assert.throws(() => {
302302
new ChainlinkDataStreamsConsumer({...config, wsUrl: null, feeds: ['0x0']});
303303
});
304-
})
304+
});
305+
306+
it("doesn't allow connectedFeeds to be mutated directly", function () {
307+
const client = new ChainlinkDataStreamsConsumer(config);
308+
assert.throws(() => client.feeds.add('0x0'));
309+
assert.throws(() => client.feeds.delete('0x0'));
310+
assert.throws(() => client.feeds.clear());
311+
});
305312

306313
it('should fetch a report for a single feed and validate the instance', async function () {
307314
for (const feed of feedIds) {

0 commit comments

Comments
 (0)