From bcddc6d39b00f9e1d3cbc608385f392f54ddfa2c Mon Sep 17 00:00:00 2001 From: Pratik Agarwal Date: Fri, 20 Oct 2023 14:40:49 -0300 Subject: [PATCH] chore: revert code that was added for testing --- packages/client-sdk-nodejs/package.json | 2 +- .../src/topic-client.ts | 55 ------------------- 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/packages/client-sdk-nodejs/package.json b/packages/client-sdk-nodejs/package.json index bf19f367c..596ab87c9 100644 --- a/packages/client-sdk-nodejs/package.json +++ b/packages/client-sdk-nodejs/package.json @@ -15,7 +15,7 @@ "scripts": { "prebuild": "eslint . --ext .ts", "test": "jest --testPathIgnorePatterns auth-client.test.ts --reporters=jest-silent-reporter", - "integration-test-auth": "jest auth-client.test.ts -t \"can generate disposable token with valid permissions, expiry and a tokenID\"", + "integration-test-auth": "jest auth-client.test.ts --reporters=jest-silent-reporter", "integration-test-vector": "jest vector-control-plane.test.ts vector-data-plane.test.ts --reporters=jest-silent-reporter", "unit-test": "jest unit --reporters=jest-silent-reporter", "integration-test": "jest integration --reporters=jest-silent-reporter --testPathIgnorePatterns \"auth-client.test.ts|vector-control-plane.test.ts|vector-data-plane.test.ts\"", diff --git a/packages/common-integration-tests/src/topic-client.ts b/packages/common-integration-tests/src/topic-client.ts index 7da8c356e..62fcda97c 100644 --- a/packages/common-integration-tests/src/topic-client.ts +++ b/packages/common-integration-tests/src/topic-client.ts @@ -158,61 +158,6 @@ export function runTopicClientTests( (subscribeResponse as TopicSubscribe.Subscription).unsubscribe(); }); - it('should publish data with tokenID client and receive them on a subscription', async () => { - const topicName = v4(); - const publishedValues = [ - 'value1', - 'value2', - new TextEncoder().encode('value3'), - ]; - const expectedValues = ['value1', 'value2', uint8ArrayForTest('value3')]; - const receivedValues: (string | Uint8Array)[] = []; - - let done = false; - const subscribeResponse = await topicClient.subscribe( - integrationTestCacheName, - topicName, - { - onItem: (item: TopicItem) => { - receivedValues.push(item.value()); - }, - onError: (error: TopicSubscribe.Error) => { - if (!done) { - expect(1).fail( - `Should not receive an error but got one: ${error.message()}` - ); - } - }, - } - ); - expectWithMessage(() => { - expect(subscribeResponse).toBeInstanceOf(TopicSubscribe.Subscription); - }, `expected SUBSCRIPTION but got ${subscribeResponse.toString()}`); - - // Wait for stream to start. - await sleep(STREAM_WAIT_TIME_MS); - - for (const value of publishedValues) { - const publishResponse = await topicClient.publish( - integrationTestCacheName, - topicName, - value - ); - expectWithMessage(() => { - expect(publishResponse).toBeInstanceOf(TopicPublish.Success); - }, `expected SUCCESS but got ${publishResponse.toString()}`); - } - - // Wait for values to be received. - await sleep(STREAM_WAIT_TIME_MS); - - expect(receivedValues).toEqual(expectedValues); - done = true; - - // Need to close the stream before the test ends or else the test will hang. - (subscribeResponse as TopicSubscribe.Subscription).unsubscribe(); - }); - it('should not receive messages when unsubscribed', async () => { const topicName = v4(); const publishedValue = 'value';