Hoppscotch lets you add dynamic behavior to REST requests. This allows you to write test suites and build requests that can contain dynamic parameters. You can add JavaScript code that executes at two events in the flow:
Tests are executed after a response is received from the server
You can add multiple tests to a request
You can add tests to both requests saved and not saved in a collection
Hoppscotch will then execute the scripts after the response is received.
As you introduce new code, tests ensure that your API is working as intended. The higher your test coverage, the more flexible and bug-resistant your code will be. You’ll be spending less time wondering why deleting a picture of a coconut breaks your code.
Hoppscotch ships a powerful API called pw which can handle post-request scripts as well as tests. Here we’ll use pw to run tests on the response received from APIs.
Let us write a test to check whether the response to our request has a status code of 200. Which means that there are no errors in the response body. We’ll use the below URL with the GET method.
https://www.httpbin.org/status/200
In this case, we’ll need to write two expect statements one for checking the status and another for checking the response body. However, we can wrap expect statements with the test method from the pw API to group related statements.There are two ways to test the status code:
Condition
Code
Check if response code is 200
pw.expect(pw.response.status).toBe(200)
In-built matcher function
pw.expect(pw.response.status).toBeLevel2xx()
pw.test("Response is ok", () => { pw.expect(pw.response.status).toBe(200);});
pw.test("Response is ok", () => { pw.expect(pw.response.status).toBeLevel2xx();});
The tests will have passed once you click on the “Send” button.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Hoppscotch Documentation","description":"Find user guides, quickstarts, tutorials, use cases, code samples, and more.","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/logo/light.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=b61955a81bc00d70adfa5f8633848cd9","dark":"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/logo/dark.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=2630e96c15d9cdafd16ed468ce7e146d"},"favicon":"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/favicon.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=50976061e41b634209dc92da5209db5b","navbar":{"primary":{"type":"github","href":"https://github.com/hoppscotch/hoppscotch"}},"footer":{"socials":{"discord":"https://hoppscotch.io/discord","x":"https://hoppscotch.io/twitter","linkedin":"https://www.linkedin.com/company/hoppscotch"}},"search":{"prompt":"Search"},"styling":{"eyebrows":"breadcrumbs","latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"hoppscotch","hasAudioNarration":false,"actualSubdomain":"hoppscotch","customDomains":["docs.hoppscotch.io"],"gitSource":{"type":"github","owner":"hoppscotch","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6abd09cc08245e67b4f3c51e","collectionId":"8167c2a3-9774-40d0-ba25-e1939dff934f","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6abd09cc08245e67b4f3c51e"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{},"buildId":"6abd09cc08245e67b4f3c51e","clientVersion":"0.0.3966","searchFilterCounts":[{"language":"default","tag":"Documentation","count":84},{"language":"default","tag":"Features","count":26},{"language":"default","tag":"Getting started","count":25},{"language":"default","tag":"Self-Host","count":20},{"language":"default","tag":"Enterprise Edition","count":12},{"language":"default","tag":"Support","count":12},{"language":"default","tag":"Resources","count":10},{"language":"default","tag":"RESTful API","count":10},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Clients","count":9}]},"assistantConfig":{},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"documentation/getting-started/rest/tests","slug":"/documentation/getting-started/rest/tests","pageMetadata":{"sidebarTitle":"Tests","title":"Tests","description":"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.","href":"/documentation/getting-started/rest/tests"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`scripts`,children:`Scripts`}),`\n`,_jsx(_components.p,{children:`Hoppscotch lets you add dynamic behavior to REST requests. This allows you to write test suites and build requests that can contain dynamic parameters. You can add JavaScript code that executes at two events in the flow:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Tests are executed after a response is received from the server`}),`\n`,_jsx(_components.li,{children:`You can add multiple tests to a request`}),`\n`,_jsx(_components.li,{children:`You can add tests to both requests saved and not saved in a collection`}),`\n`]}),`\n`,_jsx(Tip,{children:`Hoppscotch will then execute the scripts after the response is received.`}),`\n`,_jsx(Heading,{level:`2`,id:`post-request-tests`,children:`Post-request tests`}),`\n`,_jsxs(_components.p,{children:[`As you introduce new code, tests ensure that your API is working as intended. The higher your test coverage, the more flexible and bug-resistant your code will be. You’ll be spending less time wondering why `,_jsx(_components.a,{href:`https://www.thegamer.com/this-coconut-jpg-in-team-fortress-2s-game-files-if-deleted-breaks-the-game-and-no-one-knows-why`,children:`deleting a picture of a coconut breaks your code`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`writing-post-request-tests`,children:`Writing post-request tests`}),`\n`,_jsxs(_components.p,{children:[`Hoppscotch ships a powerful API called `,_jsx(_components.code,{children:`pw`}),` which can handle post-request scripts as well as tests. Here we’ll use `,_jsx(_components.code,{children:`pw`}),` to run tests on the response received from APIs.`]}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(_components.p,{children:`Let us look at some examples of how you can use Hoppscotch to write tests.`}),`\n`,_jsx(Heading,{level:`3`,id:`test-response-status-code`,children:`Test response status code`}),`\n`,_jsx(_components.p,{children:`Let us write a test to check whether the response to our request has a status code of 200. Which means that there are no errors in the response body. We’ll use the below URL with the GET method.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://www.httpbin.org/status/200`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`In this case, we’ll need to write two expect statements one for checking the status and another for checking the response body. However, we can wrap expect statements with the `,_jsx(_components.code,{children:`test`}),` method from the `,_jsx(_components.code,{children:`pw`}),` API to group related statements.`]}),`\n`,_jsx(_components.p,{children:`There are two ways to test the status code:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Condition`}),_jsx(_components.th,{children:`Code`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Check if response code is `,_jsx(_components.code,{children:`200`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pw.expect(pw.response.status).toBe(200)`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`In-built matcher function`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pw.expect(pw.response.status).toBeLevel2xx()`})})]})]})]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Response code 200`,numberOfLines:`3`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`test`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Response is ok\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`expect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toBe`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Matcher function`,numberOfLines:`3`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`test`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Response is ok\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`expect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toBeLevel2xx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`The tests will have passed once you click on the “`,_jsx(_components.strong,{children:`Send`}),`” button.`]}),`\n`,_jsx(Heading,{level:`3`,id:`assert-response-payload`,children:`Assert response payload`}),`\n`,_jsx(_components.p,{children:`In this example, we test whether a user id points to a particular user.\nLet us use the following GET API endpoint`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://reqres.in/api/users/10`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`We will use `,_jsx(_components.code,{children:`.toBe()`}),` to assert specific values and `,_jsx(_components.code,{children:`.toBeType()`}),` to assert specific data types as shown in the code snippet below:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`test`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Check first name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` user`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`body`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`expect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`first_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toBe`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Byron\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`expect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`first_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toBeType`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Running the test will produce the result as shown below:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"byron.fields@reqres.in\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"first_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Byron\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"last_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Fields\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"avatar\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://reqres.in/img/faces/10-image.jpg\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"support\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://contentcaddy.io?utm_source=reqres\u0026utm_medium=json\u0026utm_campaign=referral\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Tired of writing endless social media content? Let Content Caddy generate it for you.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"sidebarTitle":"Tests","title":"Tests","description":"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.","href":"/documentation/getting-started/rest/tests"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Scripts","slug":"scripts","depth":2,"children":[]},{"title":"Post-request tests","slug":"post-request-tests","depth":2,"children":[]},{"title":"Writing post-request tests","slug":"writing-post-request-tests","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Test response status code","slug":"test-response-status-code","depth":3,"children":[]},{"title":"Assert response payload","slug":"assert-response-payload","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"hoppscotch","siteName":"Hoppscotch Documentation","title":"Tests - Hoppscotch Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-11T04:39:27.753Z","originalFileLocation":"documentation/getting-started/rest/tests.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Hoppscotch Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Tests - Hoppscotch Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Hoppscotch Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://hoppscotch.mintlify.app/_mintlify/api/og/v2?division=RESTful+API\u0026amp;title=Tests\u0026amp;description=Write+and+run+post-request+test+scripts+to+validate+API+responses%2C+check+status+codes%2C+and+verify+data.+Add+tests+to+saved+or+unsaved+requests.\u0026amp;theme=4e522b26811728ab4595af2b\u0026amp;signature=e6ca622682dee14cab0fad37ff916b0d0377dc486720dfaa1e1356755e8d717e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Tests - Hoppscotch Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://hoppscotch.mintlify.app/_mintlify/api/og/v2?division=RESTful+API\u0026amp;title=Tests\u0026amp;description=Write+and+run+post-request+test+scripts+to+validate+API+responses%2C+check+status+codes%2C+and+verify+data.+Add+tests+to+saved+or+unsaved+requests.\u0026amp;theme=4e522b26811728ab4595af2b\u0026amp;signature=e6ca622682dee14cab0fad37ff916b0d0377dc486720dfaa1e1356755e8d717e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Hoppscotch Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/documentation/getting-started/rest/tests.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hoppscotch.io/#organization\",\"name\":\"Hoppscotch Documentation\",\"url\":\"https://docs.hoppscotch.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/logo/light.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=b61955a81bc00d70adfa5f8633848cd9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hoppscotch.io#website\",\"name\":\"Hoppscotch Documentation\",\"url\":\"https://docs.hoppscotch.io\",\"publisher\":{\"@id\":\"https://docs.hoppscotch.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests#webpage\",\"url\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests\",\"name\":\"Tests\",\"description\":\"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.\",\"dateModified\":\"2026-04-11T04:39:27.753Z\",\"isPartOf\":{\"@id\":\"https://docs.hoppscotch.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting started\",\"item\":\"https://docs.hoppscotch.io/documentation/getting-started/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RESTful API\",\"item\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/creating-a-request\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Tests\",\"item\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests#article\",\"headline\":\"Tests\",\"name\":\"Tests\",\"description\":\"Write and run post-request test scripts to validate API responses, check status codes, and verify data. Add tests to saved or unsaved requests.\",\"url\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/tests#webpage\"},\"dateModified\":\"2026-04-11T04:39:27.753Z\",\"publisher\":{\"@id\":\"https://docs.hoppscotch.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hoppscotch.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Hoppscotch Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Hoppscotch Documentation","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"lines-leaning","groups":[{"group":"Getting started","pages":[{"sidebarTitle":"Introduction","title":"Introduction to Hoppscotch","href":"/documentation/getting-started/introduction"},{"sidebarTitle":"Quick start","title":"Quick start","href":"/documentation/getting-started/quick-start"},{"sidebarTitle":"Clients","title":"Hoppscotch Clients","href":"/documentation/getting-started/clients"},{"sidebarTitle":"Setup","title":"Setup Hoppscotch","href":"/documentation/getting-started/setup"},{"sidebarTitle":"Troubleshooting","title":"Troubleshooting","href":"/documentation/getting-started/troubleshooting"},{"group":"RESTful API","pages":[{"sidebarTitle":"Creating a request","title":"Creating a request","href":"/documentation/getting-started/rest/creating-a-request"},{"sidebarTitle":"Response handling","title":"Response handling","href":"/documentation/getting-started/rest/response-handling"},{"sidebarTitle":"Request parameters","title":"Request parameters","href":"/documentation/getting-started/rest/request-parameters"},{"sidebarTitle":"Request headers","title":"Request headers","href":"/documentation/getting-started/rest/request-headers"},{"sidebarTitle":"Organizing requests","title":"Organizing requests","href":"/documentation/getting-started/rest/organizing-requests"},{"sidebarTitle":"Environment variables","title":"Environment variables","href":"/documentation/getting-started/rest/environment-variables"},{"sidebarTitle":"Using auth tokens","title":"Using auth tokens","href":"/documentation/getting-started/rest/auth-tokens"},{"sidebarTitle":"Uploading data","title":"Uploading data","href":"/documentation/getting-started/rest/uploading-data"},{"sidebarTitle":"Pre-request scripts","title":"Pre-request scripts","description":"Add pre-request scripts in Hoppscotch to execute JavaScript before sending API requests. Set variables, generate tokens, and add logic.","href":"/documentation/getting-started/rest/pre-request-scripts"},{"sidebarTitle":"Tests","title":"Tests","href":"/documentation/getting-started/rest/tests"}]},{"group":"GraphQL API","pages":[{"sidebarTitle":"Running a simple query","title":"Running a simple query","description":"Connect to a GraphQL server in Hoppscotch, explore the schema documentation, and run your first query step by step with a real API endpoint.","href":"/documentation/getting-started/graphql/creating-a-query"},{"sidebarTitle":"Using variables","title":"Using variables in a GraphQL query","href":"/documentation/getting-started/graphql/using-variables"}]},{"group":"Realtime API","pages":[{"sidebarTitle":"Websocket","title":"Websocket","href":"/documentation/getting-started/realtime/websocket"},{"sidebarTitle":"Socket.IO","title":"Socket.IO","href":"/documentation/getting-started/realtime/socket-io"},{"sidebarTitle":"SSE","title":"Server-Sent Events","href":"/documentation/getting-started/realtime/sse"},{"sidebarTitle":"MQTT","title":"MQTT","href":"/documentation/getting-started/realtime/mqtt"}]}]},{"group":"Clients","pages":[{"group":"Desktop","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch Desktop App","href":"/documentation/clients/desktop/overview"},{"sidebarTitle":"Setup","title":"Connect to Hoppscotch","href":"/documentation/clients/desktop/setup"}]},{"group":"Web","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch Web App","href":"/documentation/clients/web/overview"},{"sidebarTitle":"Progressive Web App","title":"Hoppscotch Progressive Web App","href":"/documentation/clients/web/pwa"}]},{"group":"CLI","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch CLI","href":"/documentation/clients/cli/overview"},{"sidebarTitle":"Troubleshooting","title":"Hoppscotch CLI Troubleshooting","href":"/documentation/clients/cli/troubleshooting"}]},{"group":"MCP server","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch MCP Server","href":"/documentation/clients/mcp-server/overview"},{"sidebarTitle":"Tools","title":"Hoppscotch MCP Server Tools","href":"/documentation/clients/mcp-server/tools"},{"sidebarTitle":"Troubleshooting","title":"Hoppscotch MCP Server Troubleshooting","href":"/documentation/clients/mcp-server/troubleshooting"}]}]},{"group":"Protocols","pages":[{"sidebarTitle":"RESTful","title":"RESTful","href":"/documentation/protocols/rest"},{"sidebarTitle":"GraphQL","title":"GraphQL","href":"/documentation/protocols/graphql"},{"sidebarTitle":"Realtime","title":"Realtime","href":"/documentation/protocols/realtime"}]},{"group":"Features","pages":[{"sidebarTitle":"Workspaces","title":"Workspaces","href":"/documentation/features/workspaces"},{"sidebarTitle":"Collections","title":"Collections","href":"/documentation/features/collections"},{"sidebarTitle":"Runner","title":"Runner","href":"/documentation/features/runner"},{"sidebarTitle":"Variables","title":"Variables","href":"/documentation/features/variables"},{"sidebarTitle":"Environments","title":"Environments","href":"/documentation/features/environments"},{"sidebarTitle":"Personal Access Token","title":"Personal Access Token","href":"/documentation/features/pat"},{"sidebarTitle":"History","title":"History","href":"/documentation/features/history"},{"sidebarTitle":"Spotlight","title":"Spotlight","href":"/documentation/features/spotlight"},{"sidebarTitle":"Shortcuts","title":"Shortcuts","href":"/documentation/features/shortcuts"},{"sidebarTitle":"Scripts","title":"Scripts","href":"/documentation/features/scripts"},{"sidebarTitle":"Importer","title":"Importer","href":"/documentation/features/importer"},{"sidebarTitle":"Customization","title":"Customization","href":"/documentation/features/customization"},{"sidebarTitle":"Inspections","title":"Inspections","href":"/documentation/features/inspections"},{"sidebarTitle":"Cookies","title":"Cookies","href":"/documentation/features/cookies"},{"sidebarTitle":"Client Certificate","title":"Client Certificate","href":"/documentation/features/client-certificate"},{"sidebarTitle":"Code Snippets","title":"Code Snippets","href":"/documentation/features/snippets"},{"sidebarTitle":"Interceptor","title":"Interceptor","href":"/documentation/features/interceptor"},{"sidebarTitle":"Context Menu","title":"Context Menu","href":"/documentation/features/context-menu"},{"sidebarTitle":"Widgets","title":"Widgets","href":"/documentation/features/widgets"},{"sidebarTitle":"Authorization","title":"Authorization","href":"/documentation/features/authorization"},{"sidebarTitle":"AI Features","title":"AI Features","href":"/documentation/features/ai-features"},{"sidebarTitle":"Mock","title":"API Mocking","href":"/documentation/features/mock"},{"sidebarTitle":"Documentation","title":"API Documentation","href":"/documentation/features/documentation"},{"sidebarTitle":"RESTful API","title":"RESTful API Testing","href":"/documentation/features/rest-api-testing"},{"sidebarTitle":"GraphQL API","title":"GraphQL API Testing","href":"/documentation/features/graphql-api-testing"},{"sidebarTitle":"Realtime API","title":"Realtime API Testing","href":"/documentation/features/realtime-api-testing"}]},{"group":"Self-Host","pages":[{"sidebarTitle":"Getting started","title":"Getting started with self-hosting","href":"/documentation/self-host/getting-started"},{"group":"Community Edition","pages":[{"sidebarTitle":"Getting started","title":"Getting started with Community Edition","href":"/documentation/self-host/community-edition/getting-started"},{"sidebarTitle":"Prerequisites","title":"Community Edition prerequisites","href":"/documentation/self-host/community-edition/prerequisites"},{"sidebarTitle":"Install and build","title":"Install and build Community Edition","href":"/documentation/self-host/community-edition/install-and-build"},{"sidebarTitle":"Setup and access","title":"Set up and access Community Edition","href":"/documentation/self-host/community-edition/setup-and-access"},{"sidebarTitle":"Admin dashboard","title":"Community Edition admin dashboard","href":"/documentation/self-host/community-edition/admin-dashboard"},{"sidebarTitle":"Deploy and upgrade","title":"Deploy and upgrade Community Edition","href":"/documentation/self-host/community-edition/deploy-and-upgrade"},{"sidebarTitle":"Telemetry","title":"Community Edition telemetry","href":"/documentation/self-host/community-edition/telemetry"}]},{"group":"Enterprise Edition","pages":[{"sidebarTitle":"Getting started","title":"Getting started with Enterprise Edition","href":"/documentation/self-host/enterprise-edition/getting-started"},{"sidebarTitle":"Prerequisites","title":"Enterprise Edition prerequisites","href":"/documentation/self-host/enterprise-edition/prerequisites"},{"sidebarTitle":"Install and build","title":"Install and build Enterprise Edition","href":"/documentation/self-host/enterprise-edition/install-and-build"},{"sidebarTitle":"Setup and access","title":"Set up and access Enterprise Edition","href":"/documentation/self-host/enterprise-edition/setup-and-access"},{"sidebarTitle":"Admin dashboard","title":"Enterprise Edition admin dashboard","href":"/documentation/self-host/enterprise-edition/admin-dashboard"},{"sidebarTitle":"User provisioning","title":"SCIM Integration for User and Group Provisioning","href":"/documentation/self-host/enterprise-edition/user-provisioning"},{"sidebarTitle":"Activity logs","title":"Activity logs","href":"/documentation/self-host/enterprise-edition/activity-logs"},{"sidebarTitle":"User groups","title":"User groups","href":"/documentation/self-host/enterprise-edition/user-groups"},{"sidebarTitle":"AI Assistant","title":"AI Assistant","href":"/documentation/self-host/enterprise-edition/ai-assistant"},{"sidebarTitle":"Observability","title":"Observability","href":"/documentation/self-host/enterprise-edition/observability"},{"sidebarTitle":"Deploy and upgrade","title":"Deploy and upgrade Enterprise Edition","href":"/documentation/self-host/enterprise-edition/deploy-and-upgrade"},{"sidebarTitle":"Telemetry","title":"Enterprise Edition telemetry","href":"/documentation/self-host/enterprise-edition/telemetry"}]}]},{"group":"Resources","pages":[{"sidebarTitle":"Community","title":"Hoppscotch community","href":"/documentation/community"},{"sidebarTitle":"Contributors","title":"Contributors","href":"/documentation/contributors"},{"sidebarTitle":"Changelog","title":"Changelog","href":"/documentation/changelog"},{"sidebarTitle":"Develop","title":"Develop","href":"/documentation/develop"},{"sidebarTitle":"i18n","title":"i18n","href":"/documentation/i18n"}]}]},{"anchor":"Guides","icon":"check-double","pages":[{"title":"Guides","href":"/guides/getting-started/introduction"}]},{"anchor":"Support","icon":"question","pages":[{"title":"Support","href":"/support/getting-started/introduction"}]},{"anchor":"Download","icon":"angles-down","href":"https://hoppscotch.com/download"},{"anchor":"Blog","icon":"quote-left","href":"https://hoppscotch.com/blog"},{"anchor":"Changelog","icon":"shapes","href":"https://github.com/hoppscotch/hoppscotch/releases"}]},"title":"Tests - Hoppscotch Documentation","buildId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","deploymentId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","dynamics":[],"chunks":[]}