9
9
validateInvalidDataTestCase ,
10
10
validateApiCall
11
11
} from '../deps' ;
12
- import { Socket } from 'socket.io-client' ;
13
- const { server, request, constants, rte, getSocket } = deps ;
12
+ const { server, request, constants, rte } = deps ;
14
13
15
14
// endpoint to test
16
15
const endpoint = ( instanceId = constants . TEST_INSTANCE_ID ) =>
@@ -51,19 +50,6 @@ const mainCheckFn = async (testCase) => {
51
50
} ) ;
52
51
} ;
53
52
54
- const getClient = async ( instanceId ) : Promise < Socket > => {
55
- return getSocket ( 'pub-sub' , {
56
- query : { instanceId } ,
57
- } ) ;
58
- } ;
59
-
60
- const pSubscription = {
61
- channel : '*' ,
62
- type : 'p' ,
63
- } ;
64
-
65
- let client ;
66
-
67
53
describe ( 'POST /instance/:instanceId/pub-sub/messages' , ( ) => {
68
54
describe ( 'Validation' , ( ) => {
69
55
generateInvalidDataTestCases ( dataSchema , validInputData ) . map (
@@ -72,17 +58,6 @@ describe('POST /instance/:instanceId/pub-sub/messages', () => {
72
58
} ) ;
73
59
74
60
describe ( 'Common' , ( ) => {
75
- beforeEach ( async ( ) => {
76
- client = await getClient ( constants . TEST_INSTANCE_ID ) ;
77
- await new Promise ( ( res ) => {
78
- client . emit ( 'subscribe' , { subscriptions : [ pSubscription ] } , res ) ;
79
- } ) ;
80
- } ) ;
81
-
82
- afterEach ( async ( ) => {
83
- client . close ( ) ;
84
- } ) ;
85
-
86
61
[
87
62
{
88
63
name : 'Should send message' ,
@@ -91,9 +66,6 @@ describe('POST /instance/:instanceId/pub-sub/messages', () => {
91
66
} ,
92
67
responseSchema,
93
68
statusCode : 201 ,
94
- responseBody : {
95
- affected : 1 ,
96
- } ,
97
69
} ,
98
70
{
99
71
name : 'Should return NotFound error if instance id does not exists' ,
0 commit comments