From 7f051f08c6d59885d50f7c668c52909d14ccea06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Cs=C3=A1nyi?= Date: Mon, 6 Sep 2021 17:03:38 +0200 Subject: [PATCH] test: fix examples (#127) Co-authored-by: Phil Adams --- examples/iam-identity.v1.test.js | 70 ++++++------- package-lock.json | 163 +++++++++++++++---------------- 2 files changed, 112 insertions(+), 121 deletions(-) diff --git a/examples/iam-identity.v1.test.js b/examples/iam-identity.v1.test.js index 8873c3a1..cfcc39a0 100644 --- a/examples/iam-identity.v1.test.js +++ b/examples/iam-identity.v1.test.js @@ -74,13 +74,13 @@ describe('IamIdentityV1', () => { let svcId = null; let svcIdEtag = null; - let profileId= null; + let profileId = null; let profileEtag = null; let claimRuleId = null; let claimRuleEtag = null; - let linkId =null; + let linkId = null; let accountSettingsEtag = null; @@ -92,7 +92,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('createApiKey() result:'); // begin-create_api_key @@ -121,7 +121,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('listApiKeys() result:'); // begin-list_api_keys @@ -149,7 +149,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('getApiKeysDetails() result:'); // begin-get_api_keys_details @@ -178,7 +178,7 @@ describe('IamIdentityV1', () => { }); expect(apikeyId).not.toBeNull(); - + originalLog('getApiKey() result:'); // begin-get_api_key @@ -208,7 +208,7 @@ describe('IamIdentityV1', () => { expect(apikeyId).not.toBeNull(); expect(apikeyEtag).not.toBeNull(); - + originalLog('updateApiKey() result:'); // begin-update_api_key @@ -317,7 +317,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('createServiceId() result:'); // begin-create_service_id @@ -348,7 +348,7 @@ describe('IamIdentityV1', () => { }); expect(svcId).not.toBeNull(); - + originalLog('getServiceId() result:'); // begin-get_service_id @@ -375,7 +375,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('listServiceIds() result:'); // begin-list_service_ids @@ -405,7 +405,7 @@ describe('IamIdentityV1', () => { expect(svcId).not.toBeNull(); expect(svcIdEtag).not.toBeNull(); - + originalLog('updateServiceId() result:'); // begin-update_service_id @@ -515,7 +515,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('createProfile() result:'); // begin-create_profile @@ -544,7 +544,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('getProfile() result:'); // begin-get_profile @@ -571,7 +571,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('listProfiles() result:'); // begin-list_profiles @@ -601,7 +601,7 @@ describe('IamIdentityV1', () => { expect(apikeyId).not.toBeNull(); expect(apikeyEtag).not.toBeNull(); - + originalLog('updateProfile() result:'); // begin-update_profile @@ -629,9 +629,9 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('createClaimRule() result:'); - // begin-create_claimRule + // begin-create_claim_rule const val = "{'Europe_Group'}"; const profileClaimRuleConditionsModel = { @@ -659,7 +659,7 @@ describe('IamIdentityV1', () => { console.warn(err); }); - // end-create_claimRule + // end-create_claim_rule }); test('getClaimRule request example', done => { @@ -669,9 +669,9 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('getClaimRule() result:'); - // begin-get_claimRule + // begin-get_claim_rule const params = { profileId, @@ -687,7 +687,7 @@ describe('IamIdentityV1', () => { console.warn(err); }); - // end-get_claimRule + // end-get_claim_rule }); test('listClaimRules request example', done => { @@ -697,9 +697,9 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('listClaimRules() result:'); - // begin-list_claimRules + // begin-list_claim_rules const params = { profileId, @@ -713,7 +713,7 @@ describe('IamIdentityV1', () => { console.warn(err); }); - // end-list_claimRules + // end-list_claim_rules }); test('updateClaimRule request example', done => { @@ -726,9 +726,9 @@ describe('IamIdentityV1', () => { expect(apikeyId).not.toBeNull(); expect(apikeyEtag).not.toBeNull(); - + originalLog('updateClaimRule() result:'); - // begin-update_claimRule + // begin-update_claim_rule const val = "{'Europe_Group'}"; const profileClaimRuleConditionsModel = { @@ -744,7 +744,7 @@ describe('IamIdentityV1', () => { ruleId: claimRuleId, ifMatch: claimRuleEtag, type: 'Profile-SAML', - realmName:'https://w3id.sso.ibm.com/auth/sps/samlidp2/saml20', + realmName: 'https://w3id.sso.ibm.com/auth/sps/samlidp2/saml20', expiration: 33200, conditions, }; @@ -757,7 +757,7 @@ describe('IamIdentityV1', () => { console.warn(err); }); - // end-update_claimRule + // end-update_claim_rule }); test('deleteClaimRule request example', done => { @@ -771,7 +771,7 @@ describe('IamIdentityV1', () => { expect(profileId).not.toBeNull(); expect(claimRuleId).not.toBeNull(); - // begin-delete_claimRule + // begin-delete_claim_rule const params = { profileId, @@ -786,7 +786,7 @@ describe('IamIdentityV1', () => { console.warn(err); }); - // end-delete_claimRule + // end-delete_claim_rule }); test('createLink request example', done => { @@ -796,7 +796,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('createLink() result:'); // begin-create_link @@ -832,7 +832,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('getLink() result:'); // begin-get_link @@ -859,7 +859,7 @@ describe('IamIdentityV1', () => { consoleWarnMock.mockImplementation(output => { done(output); }); - + originalLog('listLinks() result:'); // begin-list_links @@ -944,7 +944,7 @@ describe('IamIdentityV1', () => { }); expect(accountSettingsEtag).toBeNull(); - + originalLog('getAccountSettings() result:'); // begin-getAccountSettings @@ -974,7 +974,7 @@ describe('IamIdentityV1', () => { }); expect(accountSettingsEtag).not.toBeNull(); - + originalLog('updateAccountSettings() result:'); // begin-updateAccountSettings diff --git a/package-lock.json b/package-lock.json index ee5d8497..d5effbd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6266,35 +6266,35 @@ "dev": true }, "npm": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/npm/-/npm-7.20.5.tgz", - "integrity": "sha512-vRyu1V79n5BzKn4vkanag1xEjEMLIZ48Ry1V7IyAvHQHi8syOEiYWvUMxNpeDk+e8JKAKCNG3lIYJDm3pM8VMQ==", + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/npm/-/npm-7.22.0.tgz", + "integrity": "sha512-HJnjTCrGGnacPMCSnrxuHGf2H4VdrY7hwTAK1RwByg0K96KIuTR4QNioFW+bnc/pW0uwpk9lLsDf4BeEQhTv2Q==", "dev": true, "requires": { - "@npmcli/arborist": "^2.8.0", + "@npmcli/arborist": "^2.8.3", "@npmcli/ci-detect": "^1.2.0", - "@npmcli/config": "^2.2.0", + "@npmcli/config": "^2.3.0", + "@npmcli/map-workspaces": "^1.0.4", "@npmcli/package-json": "^1.0.1", - "@npmcli/run-script": "^1.8.5", + "@npmcli/run-script": "^1.8.6", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "~1.0.0", - "byte-size": "^7.0.1", - "cacache": "^15.2.0", + "cacache": "^15.3.0", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^3.1.2", "cli-table3": "^0.6.0", "columnify": "~1.5.4", + "fastest-levenshtein": "^1.0.12", "glob": "^7.1.7", "graceful-fs": "^4.2.8", "hosted-git-info": "^4.0.2", "ini": "^2.0.0", - "init-package-json": "^2.0.3", + "init-package-json": "^2.0.4", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", - "leven": "^3.1.0", "libnpmaccess": "^4.0.2", "libnpmdiff": "^2.0.4", "libnpmexec": "^2.0.1", @@ -6306,7 +6306,7 @@ "libnpmsearch": "^3.1.1", "libnpmteam": "^2.0.3", "libnpmversion": "^1.2.1", - "make-fetch-happen": "^9.0.4", + "make-fetch-happen": "^9.1.0", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -6320,19 +6320,19 @@ "npm-profile": "^5.0.3", "npm-registry-fetch": "^11.0.0", "npm-user-validate": "^1.0.1", - "npmlog": "^5.0.0", + "npmlog": "^5.0.1", "opener": "^1.5.2", "pacote": "^11.3.5", "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", - "read-package-json": "^3.0.1", + "read-package-json": "^4.1.1", "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "ssri": "^8.0.1", - "tar": "^6.1.6", + "tar": "^6.1.11", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^1.0.4", @@ -6341,8 +6341,13 @@ "write-file-atomic": "^3.0.3" }, "dependencies": { + "@gar/promisify": { + "version": "1.1.2", + "bundled": true, + "dev": true + }, "@npmcli/arborist": { - "version": "2.8.0", + "version": "2.8.3", "bundled": true, "dev": true, "requires": { @@ -6375,7 +6380,6 @@ "rimraf": "^3.0.2", "semver": "^7.3.5", "ssri": "^8.0.1", - "tar": "^6.1.0", "treeverse": "^1.0.4", "walk-up-path": "^1.0.0" } @@ -6386,7 +6390,7 @@ "dev": true }, "@npmcli/config": { - "version": "2.2.0", + "version": "2.3.0", "bundled": true, "dev": true, "requires": { @@ -6405,6 +6409,15 @@ "ansi-styles": "^4.3.0" } }, + "@npmcli/fs": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, "@npmcli/git": { "version": "2.1.0", "bundled": true, @@ -6430,7 +6443,7 @@ } }, "@npmcli/map-workspaces": { - "version": "1.0.3", + "version": "1.0.4", "bundled": true, "dev": true, "requires": { @@ -6486,13 +6499,12 @@ } }, "@npmcli/run-script": { - "version": "1.8.5", + "version": "1.8.6", "bundled": true, "dev": true, "requires": { "@npmcli/node-gyp": "^1.0.2", "@npmcli/promise-spawn": "^1.3.2", - "infer-owner": "^1.0.4", "node-gyp": "^7.1.0", "read-package-json-fast": "^2.0.1" } @@ -6579,12 +6591,12 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.5", + "version": "1.1.6", "bundled": true, "dev": true, "requires": { "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "readable-stream": "^3.6.0" } }, "asap": { @@ -6665,16 +6677,12 @@ "bundled": true, "dev": true }, - "byte-size": { - "version": "7.0.1", - "bundled": true, - "dev": true - }, "cacache": { - "version": "15.2.0", + "version": "15.3.0", "bundled": true, "dev": true, "requires": { + "@npmcli/fs": "^1.0.0", "@npmcli/move-file": "^1.0.1", "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -6972,6 +6980,11 @@ "bundled": true, "dev": true }, + "fastest-levenshtein": { + "version": "1.0.12", + "bundled": true, + "dev": true + }, "forever-agent": { "version": "0.6.1", "bundled": true, @@ -7171,7 +7184,7 @@ "dev": true }, "init-package-json": { - "version": "2.0.3", + "version": "2.0.4", "bundled": true, "dev": true, "requires": { @@ -7179,7 +7192,7 @@ "npm-package-arg": "^8.1.2", "promzard": "^0.3.0", "read": "~1.0.1", - "read-package-json": "^3.0.1", + "read-package-json": "^4.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^3.0.0" @@ -7204,7 +7217,7 @@ } }, "is-core-module": { - "version": "2.5.0", + "version": "2.6.0", "bundled": true, "dev": true, "requires": { @@ -7226,11 +7239,6 @@ "bundled": true, "dev": true }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "isexe": { "version": "2.0.0", "bundled": true, @@ -7297,11 +7305,6 @@ "bundled": true, "dev": true }, - "leven": { - "version": "3.1.0", - "bundled": true, - "dev": true - }, "libnpmaccess": { "version": "4.0.3", "bundled": true, @@ -7432,7 +7435,7 @@ } }, "make-fetch-happen": { - "version": "9.0.4", + "version": "9.1.0", "bundled": true, "dev": true, "requires": { @@ -7450,7 +7453,7 @@ "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.2", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^5.0.0", + "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" } }, @@ -7492,7 +7495,7 @@ } }, "minipass-fetch": { - "version": "1.3.4", + "version": "1.4.1", "bundled": true, "dev": true, "requires": { @@ -7651,12 +7654,12 @@ } }, "normalize-package-data": { - "version": "3.0.2", + "version": "3.0.3", "bundled": true, "dev": true, "requires": { "hosted-git-info": "^4.0.1", - "resolve": "^1.20.0", + "is-core-module": "^2.5.0", "semver": "^7.3.4", "validate-npm-package-license": "^3.0.1" } @@ -7749,14 +7752,25 @@ "dev": true }, "npmlog": { - "version": "5.0.0", + "version": "5.0.1", "bundled": true, "dev": true, "requires": { - "are-we-there-yet": "^1.1.5", + "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", "gauge": "^3.0.0", "set-blocking": "^2.0.0" + }, + "dependencies": { + "are-we-there-yet": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + } } }, "number-is-nan": { @@ -7836,11 +7850,6 @@ "bundled": true, "dev": true }, - "path-parse": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, "performance-now": { "version": "2.1.0", "bundled": true, @@ -7851,11 +7860,6 @@ "bundled": true, "dev": true }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, "promise-all-reject-late": { "version": "1.0.1", "bundled": true, @@ -7922,7 +7926,7 @@ "dev": true }, "read-package-json": { - "version": "3.0.1", + "version": "4.1.1", "bundled": true, "dev": true, "requires": { @@ -7942,17 +7946,13 @@ } }, "readable-stream": { - "version": "2.3.7", + "version": "3.6.0", "bundled": true, "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "readdir-scoped-modules": { @@ -8014,15 +8014,6 @@ } } }, - "resolve": { - "version": "1.20.0", - "bundled": true, - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, "retry": { "version": "0.12.0", "bundled": true, @@ -8037,7 +8028,7 @@ } }, "safe-buffer": { - "version": "5.1.2", + "version": "5.2.1", "bundled": true, "dev": true }, @@ -8065,7 +8056,7 @@ "dev": true }, "smart-buffer": { - "version": "4.1.0", + "version": "4.2.0", "bundled": true, "dev": true }, @@ -8079,13 +8070,13 @@ } }, "socks-proxy-agent": { - "version": "5.0.0", + "version": "6.0.0", "bundled": true, "dev": true, "requires": { - "agent-base": "6", - "debug": "4", - "socks": "^2.3.3" + "agent-base": "^6.0.2", + "debug": "^4.3.1", + "socks": "^2.6.1" } }, "spdx-correct": { @@ -8112,7 +8103,7 @@ } }, "spdx-license-ids": { - "version": "3.0.9", + "version": "3.0.10", "bundled": true, "dev": true }, @@ -8165,11 +8156,11 @@ } }, "string_decoder": { - "version": "1.1.1", + "version": "1.3.0", "bundled": true, "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, "stringify-package": { @@ -8194,7 +8185,7 @@ } }, "tar": { - "version": "6.1.6", + "version": "6.1.11", "bundled": true, "dev": true, "requires": {