{"id":21854796,"url":"https://github.com/schwabyio/xtest","last_synced_at":"2026-05-20T10:07:22.349Z","repository":{"id":140684301,"uuid":"585281634","full_name":"schwabyio/xtest","owner":"schwabyio","description":"An external assertion library to use within Postman. Test your APIs with speed, simplicity, and at scale.","archived":false,"fork":false,"pushed_at":"2025-02-25T23:33:17.000Z","size":10376,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T00:25:52.376Z","etag":null,"topics":["api","api-automated-testing","api-testing","functional-testing","postman","postman-assertions","postman-external-libraries","postman-external-library","postman-libraries","postman-library","test-automation","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schwabyio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-04T19:23:03.000Z","updated_at":"2025-02-25T23:31:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"2866a688-cb42-47c5-b71e-f48bc866a302","html_url":"https://github.com/schwabyio/xtest","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schwabyio%2Fxtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schwabyio%2Fxtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schwabyio%2Fxtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schwabyio%2Fxtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schwabyio","download_url":"https://codeload.github.com/schwabyio/xtest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244852681,"owners_count":20521159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-automated-testing","api-testing","functional-testing","postman","postman-assertions","postman-external-libraries","postman-external-library","postman-libraries","postman-library","test-automation","testing"],"created_at":"2024-11-28T02:11:28.873Z","updated_at":"2026-05-20T10:07:22.343Z","avatar_url":"https://github.com/schwabyio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![xtest Image](./resources/images/xtest-logo-500.png)\n\u003c!-- ![Postman Image](https://assets.getpostman.com/common-share/postman-logo-horizontal-320x132.png) --\u003e\n\n- [xtest - Postman Extended Test](#xtest---postman-extended-test)\n  - [Overview](#overview)\n    - [Strict Validation Support](#strict-validation-support)\n    - [Supported Content Types](#supported-content-types)\n  - [How To Install xtest Within Postman Desktop App](#how-to-install-xtest-within-postman-desktop-app)\n  - [Demo With Live Working Examples](#demo-with-live-working-examples)\n  - [Format of xtest Postman Test](#format-of-xtest-postman-test)\n    - [Sections](#sections)\n  - [xtest Assertion Functions](#xtest-assertion-functions)\n    - [expectResponseStatusCodeToBe()](#expectresponsestatuscodetobe)\n    - [expectResponseToHaveHeader()](#expectresponsetohaveheader)\n    - [expectResponseBodyToHaveProperty()](#expectresponsebodytohaveproperty)\n    - [expectResponseBodyToHaveUnorderedArray()](#expectresponsebodytohaveunorderedarray)\n    - [expectResponseBodyToHaveUnorderedArrayNotThisItem()](#expectresponsebodytohaveunorderedarraynotthisitem)\n    - [ignoreResponseBodyArrayObjectProperty()](#ignoreresponsebodyarrayobjectproperty)\n    - [Special Handling](#special-handling)\n  - [xtest Ignore Functions](#xtest-ignore-functions)\n    - [ignoreResponseBodyProperty()](#ignoreresponsebodyproperty)\n    - [ignoreResponseBodyArrayObjectProperty()](#ignoreresponsebodyarrayobjectproperty-1)\n  - [Helper Functions](#helper-functions)\n    - [date()](#date)\n\n\n# xtest - Postman Extended Test\n\n## Overview\nPostman extended test (xtest) is a module that is used within [Postman](https://www.postman.com/downloads/)/[xrun](https://github.com/schwabyio/xrun) to test your APIs with speed, simplicity, and at scale. **There is no need to write any code**; just use the simple, yet powerful, functions provided. And as a bonus, your team will be able to quickly and effortlessly understand tests across all projects, no matter who creates them.\n\n### Strict Validation Support\nA key feature of xtest is the idea of strict validation (aka `useStrictValidation`). When strict validation is enabled on a test it requires every response body property to be asserted on otherwise the test will fail. Use this for your mission critical API endpoints to provide even greater confidence in your API release cycle.\n\n\n### Supported Content Types\n| Name         | HTTP Content-Type     | Note                                                             | Live Example Demo               |\n|--------------|-----------------------|------------------------------------------------------------------|---------------------------------|\n| JSON         | application/json      |                                                                  | [See here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_VALUE.postman_collection.json)                    |\n| XML          | application/xml       | Internally xml is converted to json object using xml2js.         | [See here](./tests/postman/demo/XTEST_DEMO_XML1.postman_collection.json)                    |\n| Plain Text   | text/plain            | Internally plain text is set to json `plaintext` property.       | [See here](./tests/postman/demo/XTEST_DEMO_PLAIN_TEXT.postman_collection.json)                    |\n\n\u003cbr\u003e\n\n## How To Install xtest Within Postman Desktop App\nOpen your Postman App and create the following two global variables (Postman App -\u003e Environment -\u003e Globals -\u003e Add/Edit):\n1. VARIABLE name of ```useStrictValidation``` with a CURRENT VALUE of ```true```.\n2. VARIABLE name of ```xtest``` with a CURRENT VALUE using the latest xtest minified code (click the \"Copy source to clipboard\" button) located here: https://github.com/schwabyio/xtest/blob/master/xtest.min.js\n\n* NOTE: If you still need help, [check out this video](https://user-images.githubusercontent.com/118861343/214447365-577cf802-2c28-4632-8964-5fca068d128f.mp4)\n\n\u003cbr\u003e\n\n## Demo With Live Working Examples\n\nThere are a number of live working examples of each supported xtest function below that can be imported into your Postman Desktop app - [take a look and import them here!](./tests/postman/demo)\n\n\u003cbr\u003e\n\n## Format of xtest Postman Test\nAll xtest assertions are done within the Postman `Scripts -\u003e Post-response` section. The format will always have the following 4 sections:\n```js\n//1. Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//2. Start testing using xtest\nstartXTest(pm [Postman Object], useStrictValidation [Boolean]);\n\n//////////////////////////////////////////////////////////////\n//3. Set one or more xtest assertion functions in this section\n//////////////////////////////////////////////////////////////\n\n//4. End testing using xtest\nendXTest();\n```\n### Sections\n1. `Load xtest` - Always set exactly as is.\n    * `var xtest = eval(pm.globals.get(\"xtest\"));`\n2. `Start testing using xtest`\n    * `startXTest(pm [Postman Object], useStrictValidation [Boolean]);`\n      * Always set 1st parameter with `pm` (Postman Object).\n      * 2nd parameter is the `useStrictValidation` of type `Boolean`. Hard-code to `false` if you don't want to use strict validation in test. Otherwise, you can hard-code to `true`, but it's **instead reccomended to use the global variable `pm.globals.get(\"useStrictValidation\")` to control**.\n3. `Set one or more xtest assertion functions in this section`\n4. `End testing using xtest` - Always set exactly as is (no parameters).\n    * `endXTest();`\n\n\u003cbr\u003e\n\n## xtest Assertion Functions\n\n\u003cbr\u003e\n\n\u003cdiv id='expectResponseStatusCodeToBe'/\u003e\n\n### expectResponseStatusCodeToBe()\n\nThis function is used to validate the response http status code.\n\u003cbr\u003e\n\u003cbr\u003e\n\n**Function Type 1: ```expectResponseStatusCodeToBe(expectedValue [Number])```**\n\u003cbr\u003e\nValidate response status code as number.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseStatusCodeToBe(expectedValue);\n```\n\nFunction Details:\n```\nInputs:\nexpectedValue: [Number] - set with the expected response status code value (e.g. 200).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response status code\nexpectResponseStatusCodeToBe(200);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_STATUS_CODE_TO_BE_NUMBER.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 2: ```expectResponseStatusCodeToBe(expectedValue [Number], specialHandling [String] = \"notThisExpectedValue\")```**\n\u003cbr\u003e\nValidate response status code is NOT a given number.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseStatusCodeToBe(expectedValue, \"notThisExpectedValue\");\n```\n\nFunction Details:\n```\nInputs:\nexpectedValue: [Number] - set with the expected response status code value (e.g. 200).\n\nspecialHandling: [String] -  set with value \"notThisExpectedValue\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response status code\nexpectResponseStatusCodeToBe(201, \"notThisExpectedValue\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_STATUS_CODE_TO_NOT_BE_THIS_NUMBER.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 3: ```expectResponseStatusCodeToBe(expectedValue [RegExp])```**\n\u003cbr\u003e\nValidate response status code as regular expression.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseStatusCodeToBe(expectedValue);\n```\n\nFunction Details:\n```\nInputs:\nexpectedValue: [RegExp] - set with a regular expression to test against the expected response status code (e.g. /^2/).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response status code\nexpectResponseStatusCodeToBe(/^2/);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_STATUS_CODE_TO_BE_REGEXP.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\n**Function Type 4: ```expectResponseStatusCodeToBe(expectedValue [RegExp], specialHandling [String] = \"notThisExpectedValue\")```**\n\u003cbr\u003e\nValidate response status code is NOT a given regular expression.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseStatusCodeToBe(expectedValue, \"notThisExpectedValue\");\n```\n\nFunction Details:\n```\nInputs:\nexpectedValue: [RegExp] - set with a regular expression to test against the expected response status code (e.g. /^2/).\n\nspecialHandling: [String] -  set with value \"notThisExpectedValue\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response status code\nexpectResponseStatusCodeToBe(/^4/, \"notThisExpectedValue\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_STATUS_CODE_TO_NOT_BE_THIS_REGEXP.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 5: ```expectResponseStatusCodeToBe(collectionVariableKey [String], specialHandling [String] = \"setAsCollectionVariable\")```**\n\u003cbr\u003e\nSet the response status code as an collection variable.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseStatusCodeToBe(collectionVariableKey, \"setAsCollectionVariable\");\n```\n\nFunction Details:\n```\nInputs:\ncollectionVariableKey: [String] - set with any arbitrary collection variable key you want to use.\n\nspecialHandling: [String] -  set with value \"setAsCollectionVariable\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response status code\nexpectResponseStatusCodeToBe(\"status-code-col-var-key\", \"setAsCollectionVariable\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_STATUS_CODE_SPECIAL_HANDLING_SET_AS_COLLECTION_VARIABLE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\u003cdiv id='expectResponseToHaveHeader'/\u003e\n\n### expectResponseToHaveHeader()\n\nThis function is used to validate the response http headers.\n\u003cbr\u003e\n\u003cbr\u003e\n\n**Function Type 1: ```expectResponseToHaveHeader(expectedHeaderKey [String])```**\n\u003cbr\u003e\nValidate response header key exists. Ignore response header value.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseToHaveHeader(expectedHeaderKey);\n```\n\nFunction Details:\n```\nInputs:\nexpectedHeaderKey: [String] - set with the expected response header key (case insensitive).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response headers\nexpectResponseToHaveHeader(\"custom-header\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_TO_HAVE_HEADER_IGNORE_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 2: ```expectResponseToHaveHeader(expectedHeaderKey [String], null, specialHandling [String] = \"notThisExpectedKey\")```**\n\u003cbr\u003e\nValidate a response header key does NOT exist.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseToHaveHeader(expectedHeaderKey, null, \"notThisExpectedKey\");\n```\n\nFunction Details:\n```\nInputs:\nexpectedHeaderKey: [String] - set with the expected response header key (case insensitive).\n\nnull - set 2nd parameter to null.\n\nspecialHandling: [String] -  set with value \"notThisExpectedKey\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response headers\nexpectResponseToHaveHeader(\"some-header\", null, \"notThisExpectedKey\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_TO_NOT_HAVE_HEADER.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 3: ```expectResponseToHaveHeader(expectedHeaderKey [String], expectedHeaderValue [String])```**\n\u003cbr\u003e\nValidate response header key and header value as strings.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseToHaveHeader(expectedHeaderKey, expectedHeaderValue);\n```\n\nFunction Details:\n```\nInputs:\nexpectedHeaderKey: [String] - set with the expected response header key (case insensitive).\n\nexpectedHeaderValue: [String] -  set with the expected response header value.\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response headers\nexpectResponseToHaveHeader(\"custom-header\", \"This is the custom header value\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_TO_HAVE_HEADER_STRING_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 4: ```expectResponseToHaveHeader(expectedHeaderKey [String], expectedHeaderValue [String], specialHandling [String] = \"notThisExpectedValue\")```**\n\u003cbr\u003e\nValidate for a given response header key that the header value does NOT match.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseToHaveHeader(expectedHeaderKey, expectedHeaderValue, \"notThisExpectedValue\");\n```\n\nFunction Details:\n```\nInputs:\nexpectedHeaderKey: [String] - set with the expected response header key (case insensitive).\n\nexpectedHeaderValue: [String] -  set with the expected response header value.\n\nspecialHandling: [String] -  set with value \"notThisExpectedValue\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response headers\nexpectResponseToHaveHeader(\"custom-header\", \"This is the custom header value that will not match\", \"notThisExpectedValue\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_TO_NOT_HAVE_HEADER_STRING_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 5: ```expectResponseToHaveHeader(expectedHeaderKey [String], expectedHeaderValue [RegExp])```**\n\u003cbr\u003e\nValidate response header key as string. Validate response header value as regular expression.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseToHaveHeader(expectedHeaderKey, expectedHeaderValue);\n```\n\nFunction Details:\n```\nInputs:\nexpectedHeaderKey: [String] - set with the expected response header key (case insensitive).\n\nexpectedHeaderValue: [RegExp] -  set with a regular expression to test against the expected response header value (e.g. /someregularexpression/).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response headers\nexpectResponseToHaveHeader(\"custom-header\", /the CUSTOM hEadEr VAL/i);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_TO_HAVE_HEADER_REGEXP_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 6: ```expectResponseToHaveHeader(expectedHeaderKey [String], expectedHeaderValue [RegExp], specialHandling [String] = \"notThisExpectedValue\")```**\n\u003cbr\u003e\nValidate response header key as string. Validate response header value does NOT match regular expression.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseToHaveHeader(expectedHeaderKey, expectedHeaderValue, \"notThisExpectedValue);\n```\n\nFunction Details:\n```\nInputs:\nexpectedHeaderKey: [String] - set with the expected response header key (case insensitive).\n\nexpectedHeaderValue: [RegExp] -  set with a regular expression to test against the expected response header value (e.g. /someregularexpression/).\n\nspecialHandling: [String] -  set with value \"notThisExpectedValue\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response headers\nexpectResponseToHaveHeader(\"custom-header\", /the CUSTOM hEadEr VAL/, \"notThisExpectedValue\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_TO_NOT_HAVE_HEADER_REGEXP_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 7: ```expectResponseToHaveHeader(expectedHeaderKey [String], collectionVariableKey [String], specialHandling [String] = \"setAsCollectionVariable\")```**\n\u003cbr\u003e\nSet a response header value as an collection variable.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseToHaveHeader(expectedHeaderKey, collectionVariableKey, \"setAsCollectionVariable\");\n```\n\nFunction Details:\n```\nInputs:\nexpectedHeaderKey: [String] - set with the expected response header key (case insensitive).\n\ncollectionVariableKey: [String] - set with any arbitrary collection variable key you want to use.\n\nspecialHandling: [String] -  set with value \"setAsCollectionVariable\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response headers\nexpectResponseToHaveHeader(\"custom-header\", \"custom-header-col-var-key\", \"setAsCollectionVariable\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_HEADER_SPECIAL_HANDLING_SET_AS_COLLECTION_VARIABLE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\u003cdiv id='expectResponseBodyToHaveProperty'/\u003e\n\n### expectResponseBodyToHaveProperty()\n\nThis function is used to validate a response body property (xml is internally converted to json).\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n**Function Type 1: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String])```**\n\u003cbr\u003e\nValidate property exists. Ignore property value.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"balance.currentBalance.amount\").\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"id.value\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_IGNORE_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 2: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], null, specialHandling [String] = \"notThisExpectedKey\")```**\n\u003cbr\u003e\nValidate response body property does NOT exist (In this context, notThisExpectedKey is the jsonPathToProperty).\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, null, \"notThisExpectedKey\");\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"balance.currentBalance.amount\").\n\nnull - set 2nd parameter to null.\n\nspecialHandling: [String] -  set with value \"notThisExpectedKey\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, false);\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"id.notValid\", null, \"notThisExpectedKey\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_NOT_HAVE_RESPONSE_PROPERTY.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 3: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], expectedValue [String, Boolean, Number, or null])```**\n\u003cbr\u003e\nValidate response body property exists with expected value and expected data type.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, expectedValue);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"balance.currentBalance.amount\").\n\nexpectedValue: [String, Boolean, Number, or null] - set with the expected property value. Note: data type is also validated (i.e. String, Boolean, Number, or null).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"string.value\", \"rl3FShupSKpo8tpe07JHKOk1rRrcrvEmtaUMKJfR3hM\");\nexpectResponseBodyToHaveProperty(\"boolean.value\", true);\nexpectResponseBodyToHaveProperty(\"number.value\", 12345);\nexpectResponseBodyToHaveProperty(\"null.value\", null);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 4: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], expectedValue [String, Boolean, Number, or null], specialHandling [String] = \"notThisExpectedValue\")```**\n\u003cbr\u003e\nValidate response body property exists but NOT with a given value.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, expectedValue, \"notThisExpectedValue\");\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"balance.currentBalance.amount\").\n\nexpectedValue: [String, Boolean, Number, or null] - set with the expected property value. Note: data type is also validated (i.e. String, Boolean, Number, or null).\n\nspecialHandling: [String] -  set with value \"notThisExpectedValue\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, false);\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"string.value\", \"XXXX\", \"notThisExpectedValue\");\nexpectResponseBodyToHaveProperty(\"boolean.value\", false, \"notThisExpectedValue\");\nexpectResponseBodyToHaveProperty(\"number.value\", \"12345\", \"notThisExpectedValue\");\nexpectResponseBodyToHaveProperty(\"null.value\", undefined, \"notThisExpectedValue\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_BUT_NOT_WITH_GIVEN_VALUE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 5: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], expectedValue [RegExp])```**\n\u003cbr\u003e\nValidate response body property exists with value matched against a regular expression.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, expectedValue);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"balance.currentBalance.amount\").\n\nexpectedValue: [RegExp] - set with a regular expression to test against the expected json response property value (e.g. /someregularexpression/).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"id.value1\", /^rl3FShupS/);\nexpectResponseBodyToHaveProperty(\"id.value2\", new RegExp(\"^rl3FShupS\"));\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_REGEXP.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 6: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], expectedValue [RegExp], specialHandling [String] = \"notThisExpectedValue\")```**\n\u003cbr\u003e\nValidate response body property exists but does NOT match against a regular expression.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, expectedValue, \"notThisExpectedValue\");\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"balance.currentBalance.amount\").\n\nexpectedValue: [RegExp] - set with a regular expression to test against the expected json response property value (e.g. /someregularexpression/).\n\nspecialHandling: [String] -  set with value \"notThisExpectedValue\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"id.value\", /$rl3FShupS/, \"notThisExpectedValue\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_BUT_NOT_WITH_REGEXP_MATCH.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 7: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], expectedValue [Number], specialHandling [String] = \"dateAsEpoch\")```**\n\u003cbr\u003e\nValidate response body property exists with expectedValue as +-secondsOffset and specialHandling dateAsEpoch.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, expectedValue, \"dateAsEpoch\");\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"nextPaymentDate\").\n\nexpectedValue: [Number] - set with +-secondsOffset from now (e.g. -86400 will yesterday, 86400 will be tomorrow, 604800 will be 7 days from today).\n\nspecialHandling: [String] - set with \"dateAsEpoch\" will internally validate the expectedValue +-secondsOffset as an internally normalized date compared to the\nactualValue epoch response also as an internally normalized date.\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"epoch.date1\", 0, 'dateAsEpoch');\nexpectResponseBodyToHaveProperty(\"epoch.date2\", 86400, 'dateAsEpoch');\nexpectResponseBodyToHaveProperty(\"epoch.date3\", -86400, 'dateAsEpoch');\nexpectResponseBodyToHaveProperty(\"epoch.date4\", 604800, 'dateAsEpoch');\nexpectResponseBodyToHaveProperty(\"epoch.date5\", -604800, 'dateAsEpoch');\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_VALUE_NUMBER_DATE_AS_EPOCH.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 8: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], expectedValue [String], specialHandling [String] = \"dateAsEpoch\")```**\n\u003cbr\u003e\nValidate response body property exists with expectedValue in string format \"YYYY-MM-DD\" and specialHandling dateAsEpoch.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, expectedValue, \"dateAsEpoch\");\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property (e.g. \"nextPaymentDate\").\n\nexpectedValue: [String] - set with hard coded date in format \"YYYY-MM-DD\" (only first 10 chars of string are used) (e.g. \"2012-10-31\", \"2012-10-31-07:00\").\n\nspecialHandling: [String] - set with \"dateAsEpoch\" will internally validate the expectedValue hard coded date in format \"YYYY-MM-DD\" compared to the actualValue epoch response as an internally normalized date.\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"epoch.date1\", \"2020-10-31\", 'dateAsEpoch');\nexpectResponseBodyToHaveProperty(\"epoch.date2\", \"2020-10-31-07:00\", 'dateAsEpoch');\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_PROPERTY_VALUE_STRING_DATE_AS_EPOCH.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 9: ```expectResponseBodyToHaveProperty(jsonPathToProperty [String], collectionVariableKey [String], specialHandling [String] = \"setAsCollectionVariable\")```**\n\u003cbr\u003e\nSet a response body property as an collection variable.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveProperty(jsonPathToProperty, collectionVariableKey, \"setAsCollectionVariable\");\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the expected json path to the property.\n\ncollectionVariableKey: [String] - set with any arbitrary collection variable key you want to use.\n\nspecialHandling: [String] -  set with value \"setAsCollectionVariable\".\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"string.value\", \"string-value-col-var-key\", \"setAsCollectionVariable\");\nexpectResponseBodyToHaveProperty(\"boolean.value\", \"boolean-value-col-var-key\", \"setAsCollectionVariable\");\nexpectResponseBodyToHaveProperty(\"number.value\", \"number-value-col-var-key\", \"setAsCollectionVariable\");\nexpectResponseBodyToHaveProperty(\"null.value\", \"null-value-col-var-key\", \"setAsCollectionVariable\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_RESPONSE_PROPERTY_SPECIAL_HANDLING_SET_AS_COLLECTION_VARIABLE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\u003cdiv id='expectResponseBodyToHaveUnorderedArray'/\u003e\n\n### expectResponseBodyToHaveUnorderedArray()\n\nThis function is used to validate a response body json array that does not have a sorted or consistent order.\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n**Function Type 1: ```expectResponseBodyToHaveUnorderedArray(jsonPathToArray [String], validationList [Simple Array])```**\n\u003cbr\u003e\nValidate a response body with an unordered simple array (i.e. not an array of objects).\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveUnorderedArray(jsonPathToArray, validationList);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToArray: [String] - set with the json path to the unordered array (e.g. \"items.numeric\").\n\nvalidationList: [Simple Array] - set with the list of expected items from the json simple array (e.g. [5, 4, 2, 3, 1]).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveUnorderedArray(\"items.alpha\", [\n    \"d\",\n    \"f\",\n    \"b\",\n    \"e\",\n    \"a\",\n    \"c\"\n]);\nexpectResponseBodyToHaveUnorderedArray(\"items.numeric\", [\n    3,\n    5,\n    9,\n    1,\n    10,\n    6,\n    8,\n    4,\n    7,\n    2\n]);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_UNORDERED_ARRAY_SIMPLE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 2: ```expectResponseBodyToHaveUnorderedArray(jsonPathToArray [String], validationList [Array of Objects])```**\n\u003cbr\u003e\nValidate a response body with an unordered array of objects.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveUnorderedArray(jsonPathToArray, validationList);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToArray: [String] - set with the json path to the unordered array (e.g. \"account\").\n\nvalidationList: [Array of Objects] - set with a list of objects with the following properties to validate against the json unordered array of objects:\n  pathToProperty: [String] - set with the json path to the property relative to the 'jsonPathToArray'.\n\n  expectedValue: [String, Boolean, Number, or null] - set with the expected property value. Note: data type is also validated (i.e. String, Boolean, Number, or null).\n\n  specialHandling: [String] Optional - supported values: \"dateAsEpoch\", \"setAsCollectionVariable\", \"notThisExpectedKey\", \"notThisExpectedValue\", undefined. (NOTE: In this context, notThisExpectedKey is the pathToProperty)\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Validate response body\nexpectResponseBodyToHaveUnorderedArray(\"account\", [\n  {pathToProperty: \"id.value\", expectedValue: \"KkGHo7-dCNstHv8KT28uNzMZficQcaQwg31wIpM_uwo\"},\n  {pathToProperty: \"description\", expectedValue: \"Checking Account\"},\n  {pathToProperty: \"displayAccountNumber\", expectedValue: \"*3221\"},\n  {pathToProperty: \"accountNumber.hostValue\", expectedValue: \"7436283221\"},\n  {pathToProperty: \"category\", expectedValue: \"DEPOSIT\"},\n  {pathToProperty: \"accountType\", expectedValue: \"CHECKING\"},\n  {pathToProperty: \"balance.currentBalance.amount\", expectedValue: 1184.73},\n  {pathToProperty: \"balance.availableBalance.amount\", expectedValue: 1138.21},\n  {pathToProperty: \"asOfDate\", expectedValue: -86400, specialHandling: \"dateAsEpoch\"},\n  {pathToProperty: \"accountStatus\", expectedValue: \"OPEN\", specialHandling: undefined}\n]);\nexpectResponseBodyToHaveUnorderedArray(\"account\", [\n  {pathToProperty: \"id.value\", expectedValue: \"wKg_SyYvyrjEvC0ZqWAE3ROKIr0fPNj8-0-QkMMMgJo\"},\n  {pathToProperty: \"description\", expectedValue: \"Savings Account\"},\n  {pathToProperty: \"displayAccountNumber\", expectedValue: \"*0002\"},\n  {pathToProperty: \"category\", expectedValue: \"DEPOSIT\"},\n  {pathToProperty: \"accountType\", expectedValue: \"SAVINGS\"},\n  {pathToProperty: \"balance.currentBalance.amount\", expectedValue: 10002.73},\n  {pathToProperty: \"balance.availableBalance.amount\", expectedValue: 10001.73},\n  {pathToProperty: \"accountStatus\", expectedValue: \"OPEN\"}\n]);\nexpectResponseBodyToHaveUnorderedArray(\"account\", [\n  {pathToProperty: \"id.value\", expectedValue: \"blDDAZwefeule19fwjZ1LmytYwqnnn6fs0RHIDGEvxY\"},\n  {pathToProperty: \"description\", expectedValue: \"401K Account\"},\n  {pathToProperty: \"displayAccountNumber\", expectedValue: \"*0024\"},\n  {pathToProperty: \"accountNumber.hostValue\", expectedValue: \"9900000024\"},\n  {pathToProperty: \"category\", expectedValue: \"INVESTMENT\"},\n  {pathToProperty: \"accountType\", expectedValue: \"RETIREMENT_401_K\"},\n  {pathToProperty: \"balance.currentBalance.amount\", expectedValue: 50000},\n  {pathToProperty: \"balance.availableBalance.amount\", expectedValue: 50000},\n  {pathToProperty: \"asOfDate\", expectedValue: -86400, specialHandling: \"dateAsEpoch\"},\n  {pathToProperty: \"accountStatus\", expectedValue: \"OPEN\", specialHandling: undefined}\n]);\nexpectResponseBodyToHaveUnorderedArray(\"account\", [\n  {pathToProperty: \"id.value\", expectedValue: \"bXXVt3_SpfyIUNSPFBu0crJGDCRJG388z8iZ9Qlt78Q\"},\n  {pathToProperty: \"description\", expectedValue: \"Certificate of Deposit Account\"},\n  {pathToProperty: \"displayAccountNumber\", expectedValue: \"*0025\"},\n  {pathToProperty: \"accountNumber.hostValue\", expectedValue: \"9900000025\"},\n  {pathToProperty: \"category\", expectedValue: \"INVESTMENT\"},\n  {pathToProperty: \"accountType\", expectedValue: \"CERT_OF_DEPOSIT\"},\n  {pathToProperty: \"balance.currentBalance.amount\", expectedValue: 15000},\n  {pathToProperty: \"balance.availableBalance.amount\", expectedValue: 15000},\n  {pathToProperty: \"asOfDate\", expectedValue: -86400, specialHandling: \"dateAsEpoch\"},\n  {pathToProperty: \"accountStatus\", expectedValue: \"OPEN\", specialHandling: undefined},\n  {pathToProperty: \"interestRate\", expectedValue:  0.006},\n  {pathToProperty: \"maturityDate\", expectedValue: \"2040-01-30\", specialHandling: \"dateAsEpoch\"},\n]);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage:\n1. [Example 1: specialHandling dateAsEpoch](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_UNORDERED_ARRAY_OF_OBJECTS_1.postman_collection.json).\n2. [Example 2: specialHandling setAsCollectionVariable](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_UNORDERED_ARRAY_OF_OBJECTS_2.postman_collection.json).\n3. [Example 3: specialHandling notThisExpectedKey, notThisExpectedValue](./tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_UNORDERED_ARRAY_OF_OBJECTS_3.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\u003cdiv id='expectResponseBodyToHaveUnorderedArrayNotThisItem'/\u003e\n\n### expectResponseBodyToHaveUnorderedArrayNotThisItem()\n\nThis function is used when you need to validate one or more items are not returned in a response body with an unordered array of simple elements or objects.\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n**Function Type 1: ```expectResponseBodyToHaveUnorderedArrayNotThisItem(jsonPathToArray [String], validationList [Simple Array])```**\n\u003cbr\u003e\nValidate a simple list of item elements (1 or more) is NOT returned in response body with an unordered simple array (i.e. not an array of objects).\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveUnorderedArrayNotThisItem(jsonPathToArray, validationList);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToArray: [String] - set with the json path to the unordered array (e.g. \"items.numeric\").\n\nvalidationList: [Simple Array] - set with the list of item elements that are NOT expected to be returned in the json simple array (e.g. [5, 4, 2, 3, 1]).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, false);\n\n\n//Validate the following item is not returned\nexpectResponseBodyToHaveUnorderedArrayNotThisItem(\"items.alpha\", [\n    \"g\",\n    \"A\",\n    \"z\"\n]);\n\n//Validate the following item is not returned\nexpectResponseBodyToHaveUnorderedArrayNotThisItem(\"items.numeric\", [\n    11,\n    100\n]);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](.tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_UNORDERED_ARRAY_SIMPLE_NOT_THIS_ITEM.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n**Function Type 2: ```expectResponseBodyToHaveUnorderedArrayNotThisItem(jsonPathToArray [String], validationList [Array of Objects])```**\n\u003cbr\u003e\nValidate a list of object items (1 or more properties) are NOT returned in response body with an unordered array of objects.\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nexpectResponseBodyToHaveUnorderedArrayNotThisItem(jsonPathToArray, validationList);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToArray: [String] - set with the json path to the unordered array (e.g. \"account\").\n\nvalidationList: [Array of Objects] - set with a list of objects with the following properties to validate against the json unordered array of objects:\n  pathToProperty: [String] - set with the json path to the property relative to the 'jsonPathToArray'.\n\n  compareValue: [String, Boolean, Number, or null] - set with the expected property value. Note: data type is also validated (i.e. String, Boolean, Number, or null).\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, false);\n\n//Validate the following item is not returned\nexpectResponseBodyToHaveUnorderedArrayNotThisItem(\"items\", [\n  {pathToProperty: \"name\", compareValue: \"Item 14\"},\n  {pathToProperty: \"extraInfo\", compareValue: \"\"},\n  {pathToProperty: \"enabled\", compareValue: true},\n  {pathToProperty: \"createdAt\", compareValue: \"2025-07-27T21:37:31.402Z\"},\n]);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](.tests/postman/demo/XTEST_DEMO_EXPECT_RESPONSE_BODY_TO_HAVE_UNORDERED_ARRAY_NOT_THIS_ITEM.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\u003cdiv id='ignoreResponseBodyArrayObjectProperty'/\u003e\n\n### ignoreResponseBodyArrayObjectProperty()\n\nThis function is used to ignore a response body array of objects property (i.e. it is not an assertion). It is primarily useful when `useStrictValidation` is enabled but there is one or more specific properties within an array object that you explicitly would like to ignore and not validate (i.e. treats the response as if the ignored array object property was never returned).\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n**Function Type 1: ```ignoreResponseBodyArrayObjectProperty(jsonPathToArray [String], jsonPathOfObjectProperty [String])```**\n\u003cbr\u003e\nIgnore a response body array of objects property and all subsequent object nodes below the property value.\n\n```\nNOTE: This function MUST be placed before any assertion functions to ensure it will be ignored.\n```\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nignoreResponseBodyArrayObjectProperty(jsonPathToArray, jsonPathOfObjectProperty);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToArray: [String] - set with the json path to the unordered array (e.g. \"account\").\n\njsonPathOfObjectProperty: [String] - set with the json path of the object property you want to ignore (e.g. \"id.value\").\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Ignore\nignoreResponseBodyArrayObjectProperty(\"account\", \"id.value\");\n\n//Validate response body\nexpectResponseBodyToHaveUnorderedArray(\"account\", [\n  {pathToProperty: \"subAccounts.0.id.value\", expectedValue: \"sub-account-1\"},\n]);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](.tests/postman/demo/XTEST_DEMO_IGNORE_RESPONSE_BODY_ARRAY_OBJECT_PROPERTY.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\n\n### Special Handling\nThere are a number of special handling options supported in the assertion functions above. This table provides an overview.\n\n|Special Handling Identifier     | Description                                                                                                                            |\n|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n|`setAsEnvironmentVariable`      | Set actualValue to a Postman `Environment` type variable.                                                                              |\n|`setAsCollectionVariable`       | Set actualValue to a Postman `Collection` type variable.                                                                               |\n|`notThisExpectedKey`            | Assert that property `key` does not exist.                                                                                             |\n|`notThisExpectedValue`          | Assert that property `value` does not exist.                                                                                           |\n|`dateAsEpoch`                   | Assert that property value is valid epoch formatted date (internally normalized).                                                      |\n|`dateWithin\u003cX\u003eSec`              | Assert that property value is a date/time within + - \u003cX\u003e second(s) tolerance. Example: dateWithin1Sec, dateWithin2Sec, etc.            |\n|`integerWithin\u003cX\u003e`              | Assert that property value is an integer within + - \u003cX\u003e tolerance. Example: integerWithin1, integerWithin2, etc.                       |\n|`isArray`                       | Assert that property is an Array (without validating items within; because of this it is not compatible with `useStrictValidation`).   |\n|`isArrayAndEmpty`               | Assert that property is an Array type and is empty.                                                                                    |\n|`isArrayAndNotEmpty`            | Assert that property is an Array type and is NOT empty.                                                                                |\n|`isArrayAndHasLength`           | Assert that property is an Array type and has length/size of `expectedValue`.                                                          |\n\n\n\n## xtest Ignore Functions\n\n\u003cdiv id='ignoreResponseBodyProperty'/\u003e\n\n### ignoreResponseBodyProperty()\n\nThis function is used to ignore a response body property (i.e. it is not an assertion). It is primarily useful when `useStrictValidation` is enabled but there is one or more specific properties that you explicitly would like to ignore and not validate (i.e. treats the response as if the ignored property was never returned).\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n**Function Type 1: ```ignoreResponseBodyProperty(jsonPathToProperty [String])```**\n\u003cbr\u003e\nIgnore a response body property and all subsequent object nodes below the property value.\n\n```\nNOTE: This function MUST be placed before any assertion functions to ensure it will be ignored.\n```\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nignoreResponseBodyProperty(jsonPathToProperty);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToProperty: [String] - set with the json path to the property you want to ignore (e.g. \"items.numeric\").\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Ignore\nignoreResponseBodyProperty(\"id.value\");\n\n//Validate response body\nexpectResponseBodyToHaveProperty(\"subAccounts.0.id.value\", \"sub-account-1\");\nexpectResponseBodyToHaveProperty(\"subAccounts.1.id.value\", \"sub-account-2\");\nexpectResponseBodyToHaveProperty(\"subAccounts.2.id.value\", \"sub-account-3\");\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](.tests/postman/demo/XTEST_DEMO_IGNORE_RESPONSE_BODY_PROPERTY.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\n\u003cdiv id='ignoreResponseBodyArrayObjectProperty'/\u003e\n\n### ignoreResponseBodyArrayObjectProperty()\n\nThis function is used to ignore a response body array of objects property (i.e. it is not an assertion). It is primarily useful when `useStrictValidation` is enabled but there is one or more specific properties within an array object that you explicitly would like to ignore and not validate (i.e. treats the response as if the ignored array object property was never returned).\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n**Function Type 1: ```ignoreResponseBodyArrayObjectProperty(jsonPathToArray [String], jsonPathOfObjectProperty [String])```**\n\u003cbr\u003e\nIgnore a response body array of objects property and all subsequent object nodes below the property value.\n\n```\nNOTE: This function MUST be placed before any assertion functions to ensure it will be ignored.\n```\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\nignoreResponseBodyArrayObjectProperty(jsonPathToArray, jsonPathOfObjectProperty);\n```\n\nFunction Details:\n```\nInputs:\njsonPathToArray: [String] - set with the json path to the unordered array (e.g. \"account\").\n\njsonPathOfObjectProperty: [String] - set with the json path of the object property you want to ignore (e.g. \"id.value\").\n\nOutput:\nundefined\n```\n\nExample:\n```js\n//Load xtest\nvar xtest = eval(pm.globals.get(\"xtest\"));\n\n//Start testing using xtest\nstartXTest(pm, pm.globals.get(\"useStrictValidation\"));\n\n//Ignore\nignoreResponseBodyArrayObjectProperty(\"account\", \"id.value\");\n\n//Validate response body\nexpectResponseBodyToHaveUnorderedArray(\"account\", [\n  {pathToProperty: \"subAccounts.0.id.value\", expectedValue: \"sub-account-1\"},\n]);\n\n//End testing using xtest\nendXTest();\n```\n\nLive Demo Showing Usage - [see here](.tests/postman/demo/XTEST_DEMO_IGNORE_RESPONSE_BODY_ARRAY_OBJECT_PROPERTY.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n\n## Helper Functions\n\n\u003cdiv id='date'/\u003e\n\n### date()\n\nThis function can be used to dynamically generate a date/time value in any required format. [See here for supported dateFormat specifiers.](https://github.com/samsonjs/strftime/blob/master/Readme.md#supported-specifiers)\n\u003cdetails\u003e\n  \u003csummary\u003eClick for details.\u003c/summary\u003e\n\nFunction Name and Parameters:\n```js\ndate(dateFormat, secondsOffset, timeZoneScheme);\n```\n\nFunction Details:\n```\nInputs:\ndateFormat: [String] - set with the desired date/time format (e.g. \"%Y-%m-%d\") - see above link for all valid specifiers.\n\nsecondsOffset: [Number format: +-offsetInSeconds] - set with the number of seconds offset that you want the date/time generated for (e.g. -86400 is yesterday +604800 is 7 days from today).\n\ntimeZoneScheme: [String] set to one of the below valid time zone scheme values:\n\n\"A\"   -\u003e \"+0100\"\n\"B\"   -\u003e \"+0200\"  //e.g. EET - Eastern European Time\n\"C\"   -\u003e \"+0300\"  //e.g. EEDT - Eastern European Daylight Time\n\"D\"   -\u003e \"+0400\n\"\"E\"  -\u003e \"+0500\"\n\"IST\" -\u003e \"+0530\"  //IST Indian Standard Time (added due to support IST 30 minute offset time)\n\"F\"   -\u003e \"+0600\"\n\"G\"   -\u003e \"+0700\"\n\"H\"   -\u003e \"+0800\"  //e.g. AWST - Australian Western Standard Time\n\"I\"   -\u003e \"+0900\"  //e.g. AWDT - Australian Western Daylight Time\n\"K\"   -\u003e \"+1000\"  //e.g. AEST - Australian Eastern Standard Time\n\"L\"   -\u003e \"+1100\"  //e.g. AEDT - Australian Eastern Daylight Savings Time\n\"M\"   -\u003e \"+1200\"  //e.g. NZST - New Zealand Standard Time\n\"N\"   -\u003e \"-0100\"\n\"O\"   -\u003e \"-0200\"\n\"P\"   -\u003e \"-0300\"\n\"Q\"   -\u003e \"-0400\"  //e.g. EDT - Eastern Daylight Time (North America)\n\"R\"   -\u003e \"-0500\"  //e.g. CDT - Central Daylight Time (North America)\n\"S\"   -\u003e \"-0600\"  //e.g. CST - Central Standard Time (North America)\n\"T\"   -\u003e \"-0700\"  //e.g. PDT - Pacific Daylight Time (North America)\n\"U\"   -\u003e \"-0800\"  //e.g. PST - Pacific Standard Time (North America)\n\"V\"   -\u003e \"-0900\"  //e.g. HADT - Hawaii-Aleutian Daylight Time\n\"W\"   -\u003e \"-1000\"  //e.g. HST - Hawaii Standard Time\n\"X\"   -\u003e \"-1100\"\n\"Y\"   -\u003e \"-1200\"\n\"Z\"   -\u003e \"+0000\"  //e.g. GMT - Greenwich Mean Time\n\nOutput:\nformatted date [String or Number]\n```\n\nExample 1: date() return UTC formatted date as of *now* (i.e. no offset):\n```js\ndate('%Y-%m-%dT%H:%M:%SZ', 0, Z)\n```\n\nLive Demo Showing Usage - [see here](./tests/postman/demo/XTEST_DEMO_DATE.postman_collection.json).\n\n\u003c/details\u003e\n\u003cbr\u003e\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschwabyio%2Fxtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschwabyio%2Fxtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschwabyio%2Fxtest/lists"}