Socket
Socket
Sign inDemoInstall

ibm-cloud-sdk-core

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibm-cloud-sdk-core - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

test/utils/index.d.ts

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [2.0.1](https://github.com/IBM/node-sdk-core/compare/v2.0.0...v2.0.1) (2019-12-06)
### Bug Fixes
* convert test utils to .ts ([#74](https://github.com/IBM/node-sdk-core/issues/74)) ([ceec376](https://github.com/IBM/node-sdk-core/commit/ceec3760d50f8e958d35d4c0ca292f99a58bf795)), closes [#993](https://github.com/IBM/node-sdk-core/issues/993)
# [2.0.0](https://github.com/IBM/node-sdk-core/compare/v1.3.0...v2.0.0) (2019-11-19)

@@ -2,0 +9,0 @@

6

package.json
{
"name": "ibm-cloud-sdk-core",
"version": "2.0.0",
"version": "2.0.1",
"description": "Core functionality to support SDKs generated with IBM's OpenAPI 3 SDK Generator.",

@@ -35,2 +35,3 @@ "main": "index",

"@types/isstream": "^0.1.0",
"@types/jest": "^24.0.23",
"@types/node": "~10.14.19",

@@ -50,3 +51,4 @@ "axios": "^0.18.0",

"object.pick": "~1.3.0",
"semver": "^6.2.0"
"semver": "^6.2.0",
"ts-jest": "^24.2.0"
},

@@ -53,0 +55,0 @@ "browser": {

@@ -0,1 +1,2 @@

"use strict";
/**

@@ -16,12 +17,12 @@ * 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"));

@@ -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,6 @@ * 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;
;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc