Skip to content

Commit af43f83

Browse files
committed
Fix: create monitor-test stream in test setup
Tests [CGTB] and [CSNZ] query events with streams: ['data', 'monitor-test'] but only 'data' was created in prepare(). The missing stream caused API errors that broke both regular and streamed event queries.
1 parent d7d4f39 commit af43f83

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/test-data.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ async function prepare () {
7171
appId: 'js-lib-test'
7272
}, headers);
7373

74-
// create data stream
75-
try {
76-
await fetchPost(apiEndpoint + 'streams', {
77-
id: 'data',
78-
name: 'Data'
79-
}, { authorization: loginRes.token });
80-
} catch (e) {
74+
// create test streams
75+
for (const stream of [{ id: 'data', name: 'Data' }, { id: 'monitor-test', name: 'Monitor Test' }]) {
76+
try {
77+
await fetchPost(apiEndpoint + 'streams', stream, { authorization: loginRes.token });
78+
} catch (e) {
79+
// stream may already exist
80+
}
8181
}
8282
if (loginRes?.token == null) throw Error('Failed login process during testData prepare' + JSON.stringify(loginRes));
8383
testData.serviceInfo = serviceInfo;

0 commit comments

Comments
 (0)