ibm-cloud-sdk-core 4.3.2-beta → 4.3.2-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import expect from '
|
|
16
|
+
import { expect } from '@jest/globals';
|
|
17
17
|
/**
|
|
18
18
|
* This module provides a set of helper methods used to reduce code duplication in the generated unit tests
|
|
19
19
|
* for the SDKs that depend on this core package. Note that these methods are not used by the tests for this
|
package/lib/sdk-test-helpers.js
CHANGED
|
@@ -14,12 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
18
|
exports.expectToBePromise = exports.getOptions = exports.checkForSuccessfulExecution = exports.checkUserHeader = exports.checkMediaHeaders = exports.checkUrlAndMethod = void 0;
|
|
22
|
-
var
|
|
19
|
+
var globals_1 = require("@jest/globals");
|
|
23
20
|
/**
|
|
24
21
|
* This module provides a set of helper methods used to reduce code duplication in the generated unit tests
|
|
25
22
|
* for the SDKs that depend on this core package. Note that these methods are not used by the tests for this
|
|
@@ -34,8 +31,8 @@ var expect_1 = __importDefault(require("expect"));
|
|
|
34
31
|
* @param method - The HTTP method for the request, from the API definition
|
|
35
32
|
*/
|
|
36
33
|
function checkUrlAndMethod(options, url, method) {
|
|
37
|
-
(0,
|
|
38
|
-
(0,
|
|
34
|
+
(0, globals_1.expect)(options.url).toEqual(url);
|
|
35
|
+
(0, globals_1.expect)(options.method).toEqual(method);
|
|
39
36
|
}
|
|
40
37
|
exports.checkUrlAndMethod = checkUrlAndMethod;
|
|
41
38
|
/**
|
|
@@ -49,8 +46,8 @@ exports.checkUrlAndMethod = checkUrlAndMethod;
|
|
|
49
46
|
*/
|
|
50
47
|
function checkMediaHeaders(createRequestMock, accept, contentType) {
|
|
51
48
|
var headers = createRequestMock.mock.calls[0][0].defaultOptions.headers;
|
|
52
|
-
(0,
|
|
53
|
-
(0,
|
|
49
|
+
(0, globals_1.expect)(headers.Accept).toEqual(accept);
|
|
50
|
+
(0, globals_1.expect)(headers['Content-Type']).toEqual(contentType);
|
|
54
51
|
}
|
|
55
52
|
exports.checkMediaHeaders = checkMediaHeaders;
|
|
56
53
|
/**
|
|
@@ -64,7 +61,7 @@ exports.checkMediaHeaders = checkMediaHeaders;
|
|
|
64
61
|
*/
|
|
65
62
|
function checkUserHeader(createRequestMock, userHeaderName, userHeaderValue) {
|
|
66
63
|
var headers = createRequestMock.mock.calls[0][0].defaultOptions.headers;
|
|
67
|
-
(0,
|
|
64
|
+
(0, globals_1.expect)(headers[userHeaderName]).toEqual(userHeaderValue);
|
|
68
65
|
}
|
|
69
66
|
exports.checkUserHeader = checkUserHeader;
|
|
70
67
|
/**
|
|
@@ -75,7 +72,7 @@ exports.checkUserHeader = checkUserHeader;
|
|
|
75
72
|
*/
|
|
76
73
|
function checkForSuccessfulExecution(createRequestMock) {
|
|
77
74
|
var sdkParams = createRequestMock.mock.calls[0][0];
|
|
78
|
-
(0,
|
|
75
|
+
(0, globals_1.expect)(typeof sdkParams).toEqual('object');
|
|
79
76
|
}
|
|
80
77
|
exports.checkForSuccessfulExecution = checkForSuccessfulExecution;
|
|
81
78
|
/**
|
|
@@ -97,6 +94,6 @@ exports.getOptions = getOptions;
|
|
|
97
94
|
* @param sdkPromise - the Promise returned by an SDK method
|
|
98
95
|
*/
|
|
99
96
|
function expectToBePromise(sdkPromise) {
|
|
100
|
-
(0,
|
|
97
|
+
(0, globals_1.expect)(typeof sdkPromise.then).toBe('function');
|
|
101
98
|
}
|
|
102
99
|
exports.expectToBePromise = expectToBePromise;
|
package/package.json
CHANGED