ibm-cloud-sdk-core
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"name": "ibm-cloud-sdk-core", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Core functionality to support SDKs generated with IBM's OpenAPI 3 SDK Generator.", | ||
@@ -5,0 +5,0 @@ "main": "./index", |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -16,12 +17,13 @@ * Copyright 2019 IBM Corp. All Rights Reserved. | ||
*/ | ||
/* | ||
* The utility methods in this directory are not to assist in the testing | ||
* of the core, but to assist with the testing of the SDKs that depend on | ||
* this core library. Specifically, the unit tests generated by the | ||
* IBM OpenAPI SDK Gen project rely on these methods. | ||
*/ | ||
const unitTestUtils = require('./unit-test-helpers'); | ||
module.exports.unitTestUtils = unitTestUtils; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* | ||
* The utility methods in this directory are not to assist in the testing | ||
* of the core, but to assist with the testing of the SDKs that depend on | ||
* this core library. Specifically, the unit tests generated by the | ||
* IBM OpenAPI SDK Gen project rely on these methods. | ||
*/ | ||
__export(require("./unit-test-helpers")); | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -16,5 +17,4 @@ * Copyright 2019 IBM Corp. All Rights Reserved. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* istanbul ignore file */ | ||
/** | ||
@@ -28,3 +28,2 @@ * This module provides a set of helper methods used to reduce code duplication in the generated unit tests | ||
*/ | ||
/** | ||
@@ -39,7 +38,8 @@ * Takes the request options constructed by the SDK and checks that the `url` and `method` properties | ||
*/ | ||
module.exports.checkUrlAndMethod = function(options, url, method) { | ||
expect(options.url).toEqual(url); | ||
expect(options.method).toEqual(method); | ||
}; | ||
function checkUrlAndMethod(options, url, method) { | ||
expect(options.url).toEqual(url); | ||
expect(options.method).toEqual(method); | ||
} | ||
exports.checkUrlAndMethod = checkUrlAndMethod; | ||
; | ||
/** | ||
@@ -55,8 +55,9 @@ * Takes the mock object for the `createRequest` method, extracts the headers that were sent with the call, | ||
*/ | ||
module.exports.checkMediaHeaders = function(createRequestMock, accept, contentType) { | ||
const headers = createRequestMock.mock.calls[0][0].defaultOptions.headers; | ||
expect(headers.Accept).toEqual(accept); | ||
expect(headers['Content-Type']).toEqual(contentType); | ||
}; | ||
function checkMediaHeaders(createRequestMock, accept, contentType) { | ||
var headers = createRequestMock.mock.calls[0][0].defaultOptions.headers; | ||
expect(headers.Accept).toEqual(accept); | ||
expect(headers['Content-Type']).toEqual(contentType); | ||
} | ||
exports.checkMediaHeaders = checkMediaHeaders; | ||
; | ||
/** | ||
@@ -72,7 +73,8 @@ * Takes the mock object for the `createRequest` method, extracts the headers that were sent with the call, | ||
*/ | ||
module.exports.checkUserHeader = function(createRequestMock, userHeaderName, userHeaderValue) { | ||
const headers = createRequestMock.mock.calls[0][0].defaultOptions.headers; | ||
expect(headers[userHeaderName]).toEqual(userHeaderValue); | ||
}; | ||
function checkUserHeader(createRequestMock, userHeaderName, userHeaderValue) { | ||
var headers = createRequestMock.mock.calls[0][0].defaultOptions.headers; | ||
expect(headers[userHeaderName]).toEqual(userHeaderValue); | ||
} | ||
exports.checkUserHeader = checkUserHeader; | ||
; | ||
/** | ||
@@ -85,7 +87,8 @@ * This method simply ensures that the method executed without any issues by extracting | ||
*/ | ||
module.exports.checkForSuccessfulExecution = function(createRequestMock) { | ||
const sdkParams = createRequestMock.mock.calls[0][0]; | ||
expect(typeof sdkParams).toEqual('object'); | ||
}; | ||
function checkForSuccessfulExecution(createRequestMock) { | ||
var sdkParams = createRequestMock.mock.calls[0][0]; | ||
expect(typeof sdkParams).toEqual('object'); | ||
} | ||
exports.checkForSuccessfulExecution = checkForSuccessfulExecution; | ||
; | ||
/** | ||
@@ -97,8 +100,9 @@ * This method extracts the `options` property from the object passed into `createRequest`. This property is | ||
* @param {Object} createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class | ||
* @returns {void} | ||
* @returns {Object} | ||
*/ | ||
module.exports.getOptions = function(createRequestMock) { | ||
return createRequestMock.mock.calls[0][0].options; | ||
}; | ||
function getOptions(createRequestMock) { | ||
return createRequestMock.mock.calls[0][0].options; | ||
} | ||
exports.getOptions = getOptions; | ||
; | ||
/** | ||
@@ -111,4 +115,7 @@ * This method simply ensures that the SDK methods return Promises by checking for | ||
*/ | ||
module.exports.expectToBePromise = function(sdkPromise) { | ||
expect(typeof sdkPromise.then).toBe('function'); | ||
}; | ||
function expectToBePromise(sdkPromise) { | ||
expect(typeof sdkPromise.then).toBe('function'); | ||
} | ||
exports.expectToBePromise = expectToBePromise; | ||
; | ||
//# sourceMappingURL=unit-test-helpers.js.map |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
443474
170
8157
18
3