Skip to content

Commit

Permalink
fix(jest): vulnerability fix (#139)
Browse files Browse the repository at this point in the history
Details can be found here: IBM/node-sdk-core#166
The mentioned PR belongs to https://github.com/IBM/node-sdk-core
  • Loading branch information
Andras-Csanyi authored Oct 12, 2021
1 parent b046997 commit ff04e5e
Show file tree
Hide file tree
Showing 50 changed files with 20,172 additions and 5,885 deletions.
258 changes: 129 additions & 129 deletions examples/case-management.v1.test.js

Large diffs are not rendered by default.

1,301 changes: 669 additions & 632 deletions examples/catalog-management.v1.test.js

Large diffs are not rendered by default.

286 changes: 150 additions & 136 deletions examples/configuration-governance.v1.test.js

Large diffs are not rendered by default.

270 changes: 127 additions & 143 deletions examples/context-based-restrictions.v1.test.js

Large diffs are not rendered by default.

93 changes: 46 additions & 47 deletions examples/enterprise-billing-units.v1.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @jest-environment node
*/
* @jest-environment node
*/
/**
* (C) Copyright IBM Corp. 2020.
*
Expand Down Expand Up @@ -64,110 +64,109 @@ describe('EnterpriseBillingUnitsV1', () => {
let enterpriseId = config.enterpriseId;
let billingUnitId = config.billingUnitId;

test('getBillingUnit request example', done => {
test('getBillingUnit request example', async () => {

consoleLogMock.mockImplementation(output => {
originalLog(output);
done();
});
consoleWarnMock.mockImplementation(output => {
done(output);
originalWarn(output);
// when the test fails we need to print out the error message and stop execution right after it
expect(true).toBeFalsy();
});

originalLog('getBillingUnit() result:');
// begin-get_billing_unit
true
const params = {
billingUnitId: billingUnitId,
};

enterpriseBillingUnitsService.getBillingUnit(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});
try {
const res = await enterpriseBillingUnitsService.getBillingUnit(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}

// end-get_billing_unit
});
test('listBillingUnits request example', done => {
test('listBillingUnits request example', async () => {

consoleLogMock.mockImplementation(output => {
originalLog(output);
done();
});
consoleWarnMock.mockImplementation(output => {
done(output);
originalWarn(output);
// when the test fails we need to print out the error message and stop execution right after it
expect(true).toBeFalsy();
});

originalLog('listBillingUnits() result:');
// begin-list_billing_units

const params = {
enterpriseId: enterpriseId,
};
enterpriseBillingUnitsService.listBillingUnits(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});
try {
const res = await enterpriseBillingUnitsService.listBillingUnits(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}

// end-list_billing_units
});
test('listBillingOptions request example', done => {
test('listBillingOptions request example', async () => {

consoleLogMock.mockImplementation(output => {
originalLog(output);
done();
});
consoleWarnMock.mockImplementation(output => {
done(output);
originalWarn(output);
// when the test fails we need to print out the error message and stop execution right after it
expect(true).toBeFalsy();
});

originalLog('listBillingOptions() result:');
// begin-list_billing_options

const params = {
billingUnitId: billingUnitId,
};

enterpriseBillingUnitsService.listBillingOptions(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});
try {
const res = await enterpriseBillingUnitsService.listBillingOptions(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}

// end-list_billing_options
});
test('getCreditPools request example', done => {
test('getCreditPools request example', async () => {

consoleLogMock.mockImplementation(output => {
originalLog(output);
done();
});
consoleWarnMock.mockImplementation(output => {
done(output);
originalWarn(output);
// when the test fails we need to print out the error message and stop execution right after it
expect(true).toBeFalsy();
});

originalLog('getCreditPools() result:');
// begin-get_credit_pools

const params = {
billingUnitId: billingUnitId,
};

enterpriseBillingUnitsService.getCreditPools(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});
try {
const res = await enterpriseBillingUnitsService.getCreditPools(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}

// end-get_credit_pools
});
Expand Down
Loading

0 comments on commit ff04e5e

Please sign in to comment.