1
1
import creator from '../../ServiceBus' ;
2
2
import '../_tools/Mocks' ;
3
3
import { expect } from 'chai' ;
4
- import { outputPromise } from '../../Common/Helpers' ;
5
4
6
5
describe ( 'ServiceBus Creator tests' , function ( ) {
7
6
this . timeout ( 5000 ) ;
@@ -15,8 +14,7 @@ describe('ServiceBus Creator tests', function () {
15
14
//vaultInfo,
16
15
} ) ;
17
16
18
- const n = await outputPromise ( ( rs . resource as any ) . namespaceName ) ;
19
- expect ( n ) . to . equal ( 'test-stack-aks-bus' ) ;
17
+ ( rs . resource as any ) . namespaceName . apply ( n => expect ( n ) . to . equal ( 'test-stack-aks-bus' ) ) ;
20
18
21
19
expect ( rs . topics ) . to . undefined ;
22
20
expect ( rs . queues ) . to . undefined ;
@@ -51,19 +49,11 @@ describe('ServiceBus Creator tests', function () {
51
49
await Promise . all (
52
50
rs . topics ! . map ( async ( t ) => {
53
51
//Verify the topic name
54
- const n = await outputPromise ( ( t . topic as any ) . topicName ) ;
55
- expect ( n ) . to . equal ( 'cake-v1-tp' ) ;
52
+ ( t . topic as any ) . topicName . apply ( n => expect ( n ) . to . equal ( 'cake-v1-tp' ) ) ;
56
53
57
54
//Verify the Subscription name
58
- const sn1 = await outputPromise (
59
- ( t . subs ! [ 0 ] . resource as any ) . subscriptionName
60
- ) ;
61
- expect ( sn1 ) . to . equal ( 'eat-cakev1-sub' ) ;
62
-
63
- const sn2 = await outputPromise (
64
- ( t . subs ! [ 1 ] . resource as any ) . subscriptionName
65
- ) ;
66
- expect ( sn2 ) . to . equal ( 'eat-cakev1-session-sub' ) ;
55
+ ( t . subs ! [ 0 ] . resource as any ) . subscriptionName . apply ( sn1 => expect ( sn1 ) . to . equal ( 'eat-cakev1-sub' ) ) ;
56
+ ( t . subs ! [ 1 ] . resource as any ) . subscriptionName . apply ( sn2 => expect ( sn2 ) . to . equal ( 'eat-cakev1-session-sub' ) ) ;
67
57
} )
68
58
) ;
69
59
} ) ;
@@ -83,8 +73,7 @@ describe('ServiceBus Creator tests', function () {
83
73
await Promise . all (
84
74
rs . queues ! . map ( async ( t ) => {
85
75
//Verify the topic name
86
- const n = await outputPromise ( ( t . queue as any ) . queueName ) ;
87
- expect ( n ) . to . equal ( 'cake-v1-que' ) ;
76
+ ( t . queue as any ) . queueName . apply ( n => expect ( n ) . to . equal ( 'cake-v1-que' ) ) ;
88
77
} )
89
78
) ;
90
79
} ) ;
0 commit comments