4
4
getDataFromSpecificAddress,
5
5
} = require ( "../../../../../api-integration/helpers/request/get-data-from-address" ) ;
6
6
//Const
7
- const MOCK_OBJECT_KEY_01 = process . env . MOCK_OBJECT_KEY_01 ;
7
+ const MOCK_OBJECT_KEY_01 = process . env . MOCK_OBJECT_VALUE_01 ;
8
8
const MOCK_OBJECT_01 = { mock_object_key : MOCK_OBJECT_KEY_01 } ;
9
9
const MOCK_INVALID_IP_VALUE_01 = process . env . MOCK_INVALID_IP_01 ;
10
10
const MOCK_VALID_IP_VALUE_01 = process . env . MOCK_VALID_IP_01 ;
@@ -15,32 +15,32 @@ let getDataFromSpecificAddressResult;
15
15
describe ( "- getDataFromSpecificAddress helper (Unit Test)" , ( ) => {
16
16
describe ( "1) Check cases for arguments." , ( ) => {
17
17
msg =
18
- "Should return a object type if no arguments are passed (This function expects a single argument of string type)" ;
18
+ "Should return a string type if no arguments are passed (This function expects a single argument of string type)" ;
19
19
it ( msg , async ( ) => {
20
20
getDataFromSpecificAddressResult = await getDataFromSpecificAddress ( ) ;
21
- await expect ( typeof getDataFromSpecificAddressResult == "object " ) . toBe (
21
+ await expect ( typeof getDataFromSpecificAddressResult == "string " ) . toBe (
22
22
true
23
23
) ;
24
24
} ) ;
25
25
26
26
msg =
27
- "Should return a object type if not string argument is passed (This function expects a single argument of string type)" ;
27
+ "Should return a string type if not string argument is passed (This function expects a single argument of string type)" ;
28
28
it ( msg , async ( ) => {
29
29
getDataFromSpecificAddressResult = await getDataFromSpecificAddress (
30
30
MOCK_OBJECT_01
31
31
) ;
32
- await expect ( typeof getDataFromSpecificAddressResult == "object " ) . toBe (
32
+ await expect ( typeof getDataFromSpecificAddressResult == "string " ) . toBe (
33
33
true
34
34
) ;
35
35
} ) ;
36
36
37
37
msg =
38
- "Should return a object type if an invalid ip is passed (This function expects a single argument of string type)" ;
38
+ "Should return a string type if an invalid ip is passed (This function expects a single argument of string type)" ;
39
39
it ( msg , async ( ) => {
40
40
getDataFromSpecificAddressResult = await getDataFromSpecificAddress (
41
41
MOCK_INVALID_IP_VALUE_01
42
42
) ;
43
- await expect ( typeof getDataFromSpecificAddressResult == "object " ) . toBe (
43
+ await expect ( typeof getDataFromSpecificAddressResult == "string " ) . toBe (
44
44
true
45
45
) ;
46
46
} ) ;
@@ -51,27 +51,29 @@ describe("- getDataFromSpecificAddress helper (Unit Test)", () => {
51
51
getDataFromSpecificAddressResult = await getDataFromSpecificAddress (
52
52
MOCK_VALID_IP_VALUE_01
53
53
) ;
54
+
55
+ console . log ( "SS656756565655" + getDataFromSpecificAddressResult ) ;
54
56
await expect ( typeof getDataFromSpecificAddressResult == "object" ) . toBe (
55
57
true
56
58
) ;
57
59
} ) ;
58
60
59
61
msg =
60
- "Should return a object type if a null value is passed (This function expects a single argument of string type)" ;
62
+ "Should return a string type if a null value is passed (This function expects a single argument of string type)" ;
61
63
it ( msg , async ( ) => {
62
64
getDataFromSpecificAddressResult = await getDataFromSpecificAddress ( null ) ;
63
- await expect ( typeof getDataFromSpecificAddressResult == "object " ) . toBe (
65
+ await expect ( typeof getDataFromSpecificAddressResult == "string " ) . toBe (
64
66
true
65
67
) ;
66
68
} ) ;
67
69
68
70
msg =
69
- "Should return a object type if an undefined value is passed (This function expects a single argument of string type)" ;
71
+ "Should return a string type if an undefined value is passed (This function expects a single argument of string type)" ;
70
72
it ( msg , async ( ) => {
71
73
getDataFromSpecificAddressResult = await getDataFromSpecificAddress (
72
74
undefined
73
75
) ;
74
- await expect ( typeof getDataFromSpecificAddressResult == "object " ) . toBe (
76
+ await expect ( typeof getDataFromSpecificAddressResult == "string " ) . toBe (
75
77
true
76
78
) ;
77
79
} ) ;
0 commit comments