ibm-cloud-sdk-core 4.3.3 → 5.0.0
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.
- package/.secrets.baseline +4 -4
- package/CHANGELOG.md +25 -0
- package/MIGRATION-V5.md +15 -0
- package/build/docs/ibm-cloud-sdk-core.md +0 -24
- package/docs/ibm-cloud-sdk-core.api.json +0 -378
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -3
- package/etc/ibm-cloud-sdk-core.api.md +0 -30
- package/ibm-cloud-sdk-core.d.ts +0 -90
- package/index.d.ts +1 -3
- package/index.js +2 -16
- package/package.json +3 -5
- package/sdk-test-utilities/README.md +8 -0
- package/{es/lib/sdk-test-helpers.js → sdk-test-utilities/index.js} +41 -20
- package/sdk-test-utilities/package-lock.json +516 -0
- package/sdk-test-utilities/package.json +17 -0
- package/temp/ibm-cloud-sdk-core.api.json +0 -378
- package/temp/ibm-cloud-sdk-core.api.md +0 -30
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md +0 -53
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md +0 -85
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md +0 -85
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkuserheader.md +0 -85
- package/build/docs/ibm-cloud-sdk-core.unittestutils.expecttobepromise.md +0 -53
- package/build/docs/ibm-cloud-sdk-core.unittestutils.getoptions.md +0 -55
- package/build/docs/ibm-cloud-sdk-core.unittestutils.md +0 -86
- package/es/lib/sdk-test-helpers.browser.d.ts +0 -21
- package/es/lib/sdk-test-helpers.browser.js +0 -23
- package/es/lib/sdk-test-helpers.d.ts +0 -72
- package/lib/sdk-test-helpers.browser.d.ts +0 -21
- package/lib/sdk-test-helpers.browser.js +0 -32
- package/lib/sdk-test-helpers.d.ts +0 -72
- package/lib/sdk-test-helpers.js +0 -102
|
@@ -7405,384 +7405,6 @@
|
|
|
7405
7405
|
],
|
|
7406
7406
|
"name": "toLowerKeys"
|
|
7407
7407
|
},
|
|
7408
|
-
{
|
|
7409
|
-
"kind": "Namespace",
|
|
7410
|
-
"canonicalReference": "ibm-cloud-sdk-core!unitTestUtils:namespace",
|
|
7411
|
-
"docComment": "",
|
|
7412
|
-
"excerptTokens": [],
|
|
7413
|
-
"fileUrlPath": "dist/es/index.d.ts",
|
|
7414
|
-
"releaseTag": "None",
|
|
7415
|
-
"name": "unitTestUtils",
|
|
7416
|
-
"preserveMemberOrder": false,
|
|
7417
|
-
"members": [
|
|
7418
|
-
{
|
|
7419
|
-
"kind": "Function",
|
|
7420
|
-
"canonicalReference": "ibm-cloud-sdk-core!unitTestUtils.checkForSuccessfulExecution:function(1)",
|
|
7421
|
-
"docComment": "/**\n * This method simply ensures that the method executed without any issues by extracting the argument from the mock object for the `createRequest` method and verifying that it is an object.\n *\n * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class\n */\n",
|
|
7422
|
-
"excerptTokens": [
|
|
7423
|
-
{
|
|
7424
|
-
"kind": "Content",
|
|
7425
|
-
"text": "export declare function checkForSuccessfulExecution(createRequestMock: "
|
|
7426
|
-
},
|
|
7427
|
-
{
|
|
7428
|
-
"kind": "Content",
|
|
7429
|
-
"text": "any"
|
|
7430
|
-
},
|
|
7431
|
-
{
|
|
7432
|
-
"kind": "Content",
|
|
7433
|
-
"text": "): "
|
|
7434
|
-
},
|
|
7435
|
-
{
|
|
7436
|
-
"kind": "Content",
|
|
7437
|
-
"text": "void"
|
|
7438
|
-
},
|
|
7439
|
-
{
|
|
7440
|
-
"kind": "Content",
|
|
7441
|
-
"text": ";"
|
|
7442
|
-
}
|
|
7443
|
-
],
|
|
7444
|
-
"fileUrlPath": "dist/es/lib/sdk-test-helpers.d.ts",
|
|
7445
|
-
"returnTypeTokenRange": {
|
|
7446
|
-
"startIndex": 3,
|
|
7447
|
-
"endIndex": 4
|
|
7448
|
-
},
|
|
7449
|
-
"releaseTag": "Public",
|
|
7450
|
-
"overloadIndex": 1,
|
|
7451
|
-
"parameters": [
|
|
7452
|
-
{
|
|
7453
|
-
"parameterName": "createRequestMock",
|
|
7454
|
-
"parameterTypeTokenRange": {
|
|
7455
|
-
"startIndex": 1,
|
|
7456
|
-
"endIndex": 2
|
|
7457
|
-
},
|
|
7458
|
-
"isOptional": false
|
|
7459
|
-
}
|
|
7460
|
-
],
|
|
7461
|
-
"name": "checkForSuccessfulExecution"
|
|
7462
|
-
},
|
|
7463
|
-
{
|
|
7464
|
-
"kind": "Function",
|
|
7465
|
-
"canonicalReference": "ibm-cloud-sdk-core!unitTestUtils.checkMediaHeaders:function(1)",
|
|
7466
|
-
"docComment": "/**\n * Takes the mock object for the `createRequest` method, extracts the headers that were sent with the call, and checks for the expected values for `Accept` and `Content-Type`. This to verify that the SDK sets the correct values in the code.\n *\n * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class\n *\n * @param accept - the expected value for the `Accept` header\n *\n * @param contentType - the expected value for the `Content-Type` header\n */\n",
|
|
7467
|
-
"excerptTokens": [
|
|
7468
|
-
{
|
|
7469
|
-
"kind": "Content",
|
|
7470
|
-
"text": "export declare function checkMediaHeaders(createRequestMock: "
|
|
7471
|
-
},
|
|
7472
|
-
{
|
|
7473
|
-
"kind": "Content",
|
|
7474
|
-
"text": "any"
|
|
7475
|
-
},
|
|
7476
|
-
{
|
|
7477
|
-
"kind": "Content",
|
|
7478
|
-
"text": ", accept: "
|
|
7479
|
-
},
|
|
7480
|
-
{
|
|
7481
|
-
"kind": "Content",
|
|
7482
|
-
"text": "string"
|
|
7483
|
-
},
|
|
7484
|
-
{
|
|
7485
|
-
"kind": "Content",
|
|
7486
|
-
"text": ", contentType: "
|
|
7487
|
-
},
|
|
7488
|
-
{
|
|
7489
|
-
"kind": "Content",
|
|
7490
|
-
"text": "string"
|
|
7491
|
-
},
|
|
7492
|
-
{
|
|
7493
|
-
"kind": "Content",
|
|
7494
|
-
"text": "): "
|
|
7495
|
-
},
|
|
7496
|
-
{
|
|
7497
|
-
"kind": "Content",
|
|
7498
|
-
"text": "void"
|
|
7499
|
-
},
|
|
7500
|
-
{
|
|
7501
|
-
"kind": "Content",
|
|
7502
|
-
"text": ";"
|
|
7503
|
-
}
|
|
7504
|
-
],
|
|
7505
|
-
"fileUrlPath": "dist/es/lib/sdk-test-helpers.d.ts",
|
|
7506
|
-
"returnTypeTokenRange": {
|
|
7507
|
-
"startIndex": 7,
|
|
7508
|
-
"endIndex": 8
|
|
7509
|
-
},
|
|
7510
|
-
"releaseTag": "Public",
|
|
7511
|
-
"overloadIndex": 1,
|
|
7512
|
-
"parameters": [
|
|
7513
|
-
{
|
|
7514
|
-
"parameterName": "createRequestMock",
|
|
7515
|
-
"parameterTypeTokenRange": {
|
|
7516
|
-
"startIndex": 1,
|
|
7517
|
-
"endIndex": 2
|
|
7518
|
-
},
|
|
7519
|
-
"isOptional": false
|
|
7520
|
-
},
|
|
7521
|
-
{
|
|
7522
|
-
"parameterName": "accept",
|
|
7523
|
-
"parameterTypeTokenRange": {
|
|
7524
|
-
"startIndex": 3,
|
|
7525
|
-
"endIndex": 4
|
|
7526
|
-
},
|
|
7527
|
-
"isOptional": false
|
|
7528
|
-
},
|
|
7529
|
-
{
|
|
7530
|
-
"parameterName": "contentType",
|
|
7531
|
-
"parameterTypeTokenRange": {
|
|
7532
|
-
"startIndex": 5,
|
|
7533
|
-
"endIndex": 6
|
|
7534
|
-
},
|
|
7535
|
-
"isOptional": false
|
|
7536
|
-
}
|
|
7537
|
-
],
|
|
7538
|
-
"name": "checkMediaHeaders"
|
|
7539
|
-
},
|
|
7540
|
-
{
|
|
7541
|
-
"kind": "Function",
|
|
7542
|
-
"canonicalReference": "ibm-cloud-sdk-core!unitTestUtils.checkUrlAndMethod:function(1)",
|
|
7543
|
-
"docComment": "/**\n * Takes the request options constructed by the SDK and checks that the `url` and `method` properties were set to their correct values.\n *\n * @param options - the options object put together by the SDK, retrieved from the createRequest mock\n *\n * @param url - The URL path of the service endpoint, from the paths section of the API definition\n *\n * @param method - The HTTP method for the request, from the API definition\n */\n",
|
|
7544
|
-
"excerptTokens": [
|
|
7545
|
-
{
|
|
7546
|
-
"kind": "Content",
|
|
7547
|
-
"text": "export declare function checkUrlAndMethod(options: "
|
|
7548
|
-
},
|
|
7549
|
-
{
|
|
7550
|
-
"kind": "Content",
|
|
7551
|
-
"text": "any"
|
|
7552
|
-
},
|
|
7553
|
-
{
|
|
7554
|
-
"kind": "Content",
|
|
7555
|
-
"text": ", url: "
|
|
7556
|
-
},
|
|
7557
|
-
{
|
|
7558
|
-
"kind": "Content",
|
|
7559
|
-
"text": "string"
|
|
7560
|
-
},
|
|
7561
|
-
{
|
|
7562
|
-
"kind": "Content",
|
|
7563
|
-
"text": ", method: "
|
|
7564
|
-
},
|
|
7565
|
-
{
|
|
7566
|
-
"kind": "Content",
|
|
7567
|
-
"text": "any"
|
|
7568
|
-
},
|
|
7569
|
-
{
|
|
7570
|
-
"kind": "Content",
|
|
7571
|
-
"text": "): "
|
|
7572
|
-
},
|
|
7573
|
-
{
|
|
7574
|
-
"kind": "Content",
|
|
7575
|
-
"text": "void"
|
|
7576
|
-
},
|
|
7577
|
-
{
|
|
7578
|
-
"kind": "Content",
|
|
7579
|
-
"text": ";"
|
|
7580
|
-
}
|
|
7581
|
-
],
|
|
7582
|
-
"fileUrlPath": "dist/es/lib/sdk-test-helpers.d.ts",
|
|
7583
|
-
"returnTypeTokenRange": {
|
|
7584
|
-
"startIndex": 7,
|
|
7585
|
-
"endIndex": 8
|
|
7586
|
-
},
|
|
7587
|
-
"releaseTag": "Public",
|
|
7588
|
-
"overloadIndex": 1,
|
|
7589
|
-
"parameters": [
|
|
7590
|
-
{
|
|
7591
|
-
"parameterName": "options",
|
|
7592
|
-
"parameterTypeTokenRange": {
|
|
7593
|
-
"startIndex": 1,
|
|
7594
|
-
"endIndex": 2
|
|
7595
|
-
},
|
|
7596
|
-
"isOptional": false
|
|
7597
|
-
},
|
|
7598
|
-
{
|
|
7599
|
-
"parameterName": "url",
|
|
7600
|
-
"parameterTypeTokenRange": {
|
|
7601
|
-
"startIndex": 3,
|
|
7602
|
-
"endIndex": 4
|
|
7603
|
-
},
|
|
7604
|
-
"isOptional": false
|
|
7605
|
-
},
|
|
7606
|
-
{
|
|
7607
|
-
"parameterName": "method",
|
|
7608
|
-
"parameterTypeTokenRange": {
|
|
7609
|
-
"startIndex": 5,
|
|
7610
|
-
"endIndex": 6
|
|
7611
|
-
},
|
|
7612
|
-
"isOptional": false
|
|
7613
|
-
}
|
|
7614
|
-
],
|
|
7615
|
-
"name": "checkUrlAndMethod"
|
|
7616
|
-
},
|
|
7617
|
-
{
|
|
7618
|
-
"kind": "Function",
|
|
7619
|
-
"canonicalReference": "ibm-cloud-sdk-core!unitTestUtils.checkUserHeader:function(1)",
|
|
7620
|
-
"docComment": "/**\n * Takes the mock object for the `createRequest` method, extracts the headers that were sent with the call, and checks for the expected value for a user-defined header. This is verify that the SDK accepts header parameters and sends them as headers in the request.\n *\n * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class\n *\n * @param userHeaderName - the name of the header passed by the user, e.g. `Contained-Content-Type`\n *\n * @param userHeaderValue - the expected value for the header passed by the user\n */\n",
|
|
7621
|
-
"excerptTokens": [
|
|
7622
|
-
{
|
|
7623
|
-
"kind": "Content",
|
|
7624
|
-
"text": "export declare function checkUserHeader(createRequestMock: "
|
|
7625
|
-
},
|
|
7626
|
-
{
|
|
7627
|
-
"kind": "Content",
|
|
7628
|
-
"text": "any"
|
|
7629
|
-
},
|
|
7630
|
-
{
|
|
7631
|
-
"kind": "Content",
|
|
7632
|
-
"text": ", userHeaderName: "
|
|
7633
|
-
},
|
|
7634
|
-
{
|
|
7635
|
-
"kind": "Content",
|
|
7636
|
-
"text": "string"
|
|
7637
|
-
},
|
|
7638
|
-
{
|
|
7639
|
-
"kind": "Content",
|
|
7640
|
-
"text": ", userHeaderValue: "
|
|
7641
|
-
},
|
|
7642
|
-
{
|
|
7643
|
-
"kind": "Content",
|
|
7644
|
-
"text": "string"
|
|
7645
|
-
},
|
|
7646
|
-
{
|
|
7647
|
-
"kind": "Content",
|
|
7648
|
-
"text": "): "
|
|
7649
|
-
},
|
|
7650
|
-
{
|
|
7651
|
-
"kind": "Content",
|
|
7652
|
-
"text": "void"
|
|
7653
|
-
},
|
|
7654
|
-
{
|
|
7655
|
-
"kind": "Content",
|
|
7656
|
-
"text": ";"
|
|
7657
|
-
}
|
|
7658
|
-
],
|
|
7659
|
-
"fileUrlPath": "dist/es/lib/sdk-test-helpers.d.ts",
|
|
7660
|
-
"returnTypeTokenRange": {
|
|
7661
|
-
"startIndex": 7,
|
|
7662
|
-
"endIndex": 8
|
|
7663
|
-
},
|
|
7664
|
-
"releaseTag": "Public",
|
|
7665
|
-
"overloadIndex": 1,
|
|
7666
|
-
"parameters": [
|
|
7667
|
-
{
|
|
7668
|
-
"parameterName": "createRequestMock",
|
|
7669
|
-
"parameterTypeTokenRange": {
|
|
7670
|
-
"startIndex": 1,
|
|
7671
|
-
"endIndex": 2
|
|
7672
|
-
},
|
|
7673
|
-
"isOptional": false
|
|
7674
|
-
},
|
|
7675
|
-
{
|
|
7676
|
-
"parameterName": "userHeaderName",
|
|
7677
|
-
"parameterTypeTokenRange": {
|
|
7678
|
-
"startIndex": 3,
|
|
7679
|
-
"endIndex": 4
|
|
7680
|
-
},
|
|
7681
|
-
"isOptional": false
|
|
7682
|
-
},
|
|
7683
|
-
{
|
|
7684
|
-
"parameterName": "userHeaderValue",
|
|
7685
|
-
"parameterTypeTokenRange": {
|
|
7686
|
-
"startIndex": 5,
|
|
7687
|
-
"endIndex": 6
|
|
7688
|
-
},
|
|
7689
|
-
"isOptional": false
|
|
7690
|
-
}
|
|
7691
|
-
],
|
|
7692
|
-
"name": "checkUserHeader"
|
|
7693
|
-
},
|
|
7694
|
-
{
|
|
7695
|
-
"kind": "Function",
|
|
7696
|
-
"canonicalReference": "ibm-cloud-sdk-core!unitTestUtils.expectToBePromise:function(1)",
|
|
7697
|
-
"docComment": "/**\n * This method simply ensures that the SDK methods return Promises by checking for the `then` function - common way to assess whether or not an object is a Promise.\n *\n * @param sdkPromise - the Promise returned by an SDK method\n */\n",
|
|
7698
|
-
"excerptTokens": [
|
|
7699
|
-
{
|
|
7700
|
-
"kind": "Content",
|
|
7701
|
-
"text": "export declare function expectToBePromise(sdkPromise: "
|
|
7702
|
-
},
|
|
7703
|
-
{
|
|
7704
|
-
"kind": "Content",
|
|
7705
|
-
"text": "any"
|
|
7706
|
-
},
|
|
7707
|
-
{
|
|
7708
|
-
"kind": "Content",
|
|
7709
|
-
"text": "): "
|
|
7710
|
-
},
|
|
7711
|
-
{
|
|
7712
|
-
"kind": "Content",
|
|
7713
|
-
"text": "void"
|
|
7714
|
-
},
|
|
7715
|
-
{
|
|
7716
|
-
"kind": "Content",
|
|
7717
|
-
"text": ";"
|
|
7718
|
-
}
|
|
7719
|
-
],
|
|
7720
|
-
"fileUrlPath": "dist/es/lib/sdk-test-helpers.d.ts",
|
|
7721
|
-
"returnTypeTokenRange": {
|
|
7722
|
-
"startIndex": 3,
|
|
7723
|
-
"endIndex": 4
|
|
7724
|
-
},
|
|
7725
|
-
"releaseTag": "Public",
|
|
7726
|
-
"overloadIndex": 1,
|
|
7727
|
-
"parameters": [
|
|
7728
|
-
{
|
|
7729
|
-
"parameterName": "sdkPromise",
|
|
7730
|
-
"parameterTypeTokenRange": {
|
|
7731
|
-
"startIndex": 1,
|
|
7732
|
-
"endIndex": 2
|
|
7733
|
-
},
|
|
7734
|
-
"isOptional": false
|
|
7735
|
-
}
|
|
7736
|
-
],
|
|
7737
|
-
"name": "expectToBePromise"
|
|
7738
|
-
},
|
|
7739
|
-
{
|
|
7740
|
-
"kind": "Function",
|
|
7741
|
-
"canonicalReference": "ibm-cloud-sdk-core!unitTestUtils.getOptions:function(1)",
|
|
7742
|
-
"docComment": "/**\n * This method extracts the `options` property from the object passed into `createRequest`. This property is an object containing all of the SDK method-specific information (like `path` and `body`) used to build a request. This method is just a convenience method for the unit tests to be able to make assertions on the items in the request.\n *\n * @param createRequestMock - the jest mock object for the `createRequest` method in the `RequestWrapper` class\n *\n * @returns Object\n */\n",
|
|
7743
|
-
"excerptTokens": [
|
|
7744
|
-
{
|
|
7745
|
-
"kind": "Content",
|
|
7746
|
-
"text": "export declare function getOptions(createRequestMock: "
|
|
7747
|
-
},
|
|
7748
|
-
{
|
|
7749
|
-
"kind": "Content",
|
|
7750
|
-
"text": "any"
|
|
7751
|
-
},
|
|
7752
|
-
{
|
|
7753
|
-
"kind": "Content",
|
|
7754
|
-
"text": "): "
|
|
7755
|
-
},
|
|
7756
|
-
{
|
|
7757
|
-
"kind": "Content",
|
|
7758
|
-
"text": "any"
|
|
7759
|
-
},
|
|
7760
|
-
{
|
|
7761
|
-
"kind": "Content",
|
|
7762
|
-
"text": ";"
|
|
7763
|
-
}
|
|
7764
|
-
],
|
|
7765
|
-
"fileUrlPath": "dist/es/lib/sdk-test-helpers.d.ts",
|
|
7766
|
-
"returnTypeTokenRange": {
|
|
7767
|
-
"startIndex": 3,
|
|
7768
|
-
"endIndex": 4
|
|
7769
|
-
},
|
|
7770
|
-
"releaseTag": "Public",
|
|
7771
|
-
"overloadIndex": 1,
|
|
7772
|
-
"parameters": [
|
|
7773
|
-
{
|
|
7774
|
-
"parameterName": "createRequestMock",
|
|
7775
|
-
"parameterTypeTokenRange": {
|
|
7776
|
-
"startIndex": 1,
|
|
7777
|
-
"endIndex": 2
|
|
7778
|
-
},
|
|
7779
|
-
"isOptional": false
|
|
7780
|
-
}
|
|
7781
|
-
],
|
|
7782
|
-
"name": "getOptions"
|
|
7783
|
-
}
|
|
7784
|
-
]
|
|
7785
|
-
},
|
|
7786
7408
|
{
|
|
7787
7409
|
"kind": "Interface",
|
|
7788
7410
|
"canonicalReference": "ibm-cloud-sdk-core!UserOptions:interface",
|
|
@@ -105,18 +105,6 @@ export function buildRequestFileObject(fileParam: FileWithMetadata): Promise<Fil
|
|
|
105
105
|
// @public
|
|
106
106
|
export function checkCredentials(obj: any, credsToCheck: string[]): Error | null;
|
|
107
107
|
|
|
108
|
-
// @public
|
|
109
|
-
function checkForSuccessfulExecution(createRequestMock: any): void;
|
|
110
|
-
|
|
111
|
-
// @public
|
|
112
|
-
function checkMediaHeaders(createRequestMock: any, accept: string, contentType: string): void;
|
|
113
|
-
|
|
114
|
-
// @public
|
|
115
|
-
function checkUrlAndMethod(options: any, url: string, method: any): void;
|
|
116
|
-
|
|
117
|
-
// @public
|
|
118
|
-
function checkUserHeader(createRequestMock: any, userHeaderName: string, userHeaderValue: string): void;
|
|
119
|
-
|
|
120
108
|
// @public
|
|
121
109
|
export class CloudPakForDataAuthenticator extends TokenRequestBasedAuthenticator {
|
|
122
110
|
// Warning: (ae-forgotten-export) The symbol "Options_4" needs to be exported by the entry point index.d.ts
|
|
@@ -176,9 +164,6 @@ export class Cp4dTokenManager extends JwtTokenManager {
|
|
|
176
164
|
protected requiredOptions: string[];
|
|
177
165
|
}
|
|
178
166
|
|
|
179
|
-
// @public
|
|
180
|
-
function expectToBePromise(sdkPromise: any): void;
|
|
181
|
-
|
|
182
167
|
// @public (undocumented)
|
|
183
168
|
export function fileExistsAtPath(filepath: string): boolean;
|
|
184
169
|
|
|
@@ -236,9 +221,6 @@ export function getMissingParams(params: {
|
|
|
236
221
|
// @public
|
|
237
222
|
export function getNewLogger(moduleName: string): SDKLogger;
|
|
238
223
|
|
|
239
|
-
// @public
|
|
240
|
-
function getOptions(createRequestMock: any): any;
|
|
241
|
-
|
|
242
224
|
// @public
|
|
243
225
|
export function getQueryParam(urlStr: string, param: string): string;
|
|
244
226
|
|
|
@@ -458,18 +440,6 @@ export class TokenRequestBasedAuthenticator extends Authenticator {
|
|
|
458
440
|
// @public
|
|
459
441
|
export function toLowerKeys(obj: Object): Object;
|
|
460
442
|
|
|
461
|
-
declare namespace unitTestUtils {
|
|
462
|
-
export {
|
|
463
|
-
checkUrlAndMethod,
|
|
464
|
-
checkMediaHeaders,
|
|
465
|
-
checkUserHeader,
|
|
466
|
-
checkForSuccessfulExecution,
|
|
467
|
-
getOptions,
|
|
468
|
-
expectToBePromise
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
export { unitTestUtils }
|
|
472
|
-
|
|
473
443
|
// @public
|
|
474
444
|
export interface UserOptions {
|
|
475
445
|
[propName: string]: any;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) > [unitTestUtils](./ibm-cloud-sdk-core.unittestutils.md) > [checkForSuccessfulExecution](./ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md)
|
|
4
|
-
|
|
5
|
-
## unitTestUtils.checkForSuccessfulExecution() function
|
|
6
|
-
|
|
7
|
-
This method simply ensures that the method executed without any issues by extracting the argument from the mock object for the `createRequest` method and verifying that it is an object.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function checkForSuccessfulExecution(createRequestMock: any): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
createRequestMock
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
any
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
the jest mock object for the `createRequest` method in the `RequestWrapper` class
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
**Returns:**
|
|
51
|
-
|
|
52
|
-
void
|
|
53
|
-
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) > [unitTestUtils](./ibm-cloud-sdk-core.unittestutils.md) > [checkMediaHeaders](./ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md)
|
|
4
|
-
|
|
5
|
-
## unitTestUtils.checkMediaHeaders() function
|
|
6
|
-
|
|
7
|
-
Takes the mock object for the `createRequest` method, extracts the headers that were sent with the call, and checks for the expected values for `Accept` and `Content-Type`<!-- -->. This to verify that the SDK sets the correct values in the code.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function checkMediaHeaders(createRequestMock: any, accept: string, contentType: string): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
createRequestMock
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
any
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
the jest mock object for the `createRequest` method in the `RequestWrapper` class
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
<tr><td>
|
|
50
|
-
|
|
51
|
-
accept
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</td><td>
|
|
55
|
-
|
|
56
|
-
string
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
the expected value for the `Accept` header
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</td></tr>
|
|
65
|
-
<tr><td>
|
|
66
|
-
|
|
67
|
-
contentType
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</td><td>
|
|
71
|
-
|
|
72
|
-
string
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</td><td>
|
|
76
|
-
|
|
77
|
-
the expected value for the `Content-Type` header
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</td></tr>
|
|
81
|
-
</tbody></table>
|
|
82
|
-
**Returns:**
|
|
83
|
-
|
|
84
|
-
void
|
|
85
|
-
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) > [unitTestUtils](./ibm-cloud-sdk-core.unittestutils.md) > [checkUrlAndMethod](./ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md)
|
|
4
|
-
|
|
5
|
-
## unitTestUtils.checkUrlAndMethod() function
|
|
6
|
-
|
|
7
|
-
Takes the request options constructed by the SDK and checks that the `url` and `method` properties were set to their correct values.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function checkUrlAndMethod(options: any, url: string, method: any): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
options
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
any
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
the options object put together by the SDK, retrieved from the createRequest mock
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
<tr><td>
|
|
50
|
-
|
|
51
|
-
url
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</td><td>
|
|
55
|
-
|
|
56
|
-
string
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
The URL path of the service endpoint, from the paths section of the API definition
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</td></tr>
|
|
65
|
-
<tr><td>
|
|
66
|
-
|
|
67
|
-
method
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</td><td>
|
|
71
|
-
|
|
72
|
-
any
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</td><td>
|
|
76
|
-
|
|
77
|
-
The HTTP method for the request, from the API definition
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</td></tr>
|
|
81
|
-
</tbody></table>
|
|
82
|
-
**Returns:**
|
|
83
|
-
|
|
84
|
-
void
|
|
85
|
-
|