{"id":49179,"library":"rest-assured-ts","title":"Rest-Assured-TS","description":"Rest-Assured-TS (v0.1.8) is a TypeScript/JavaScript REST API test automation library inspired by Postman, RestAssured, and Karate. It supports Cucumber, Mocha, Jest, CommonJS, ES6, and TypeScript. Key differentiators include implicit Chai assertion support for JSON responses, file-based request/response handling, and JSON path validation. The library is actively maintained and aims to provide a low-code approach for REST API testing.","status":"active","version":"0.1.8","language":"javascript","source_language":"en","source_url":"https://github.com/automatekitbox/cucumber-rest-assured-typescript","tags":["javascript","rest","postman","got","axios","mocha","chai","cucumber","test"],"install":[{"cmd":"npm install rest-assured-ts","lang":"bash","label":"npm"},{"cmd":"yarn add rest-assured-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add rest-assured-ts","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP client used for making requests","package":"got","optional":false},{"reason":"Assertion library for response validation","package":"chai","optional":true}],"imports":[{"note":"ESM-style import is recommended; CommonJS require still works but may not have TypeScript types.","wrong":"const restRequest = require('rest-assured-ts')","symbol":"restRequest","correct":"import { restRequest } from 'rest-assured-ts'"},{"note":"There is no default export; use named imports like restRequest or restRequestSync.","wrong":"const rest = require('rest-assured-ts')","symbol":"default import","correct":"import rest from 'rest-assured-ts'"},{"note":"Synchronous version of restRequest for simple usage.","wrong":null,"symbol":"restRequestSync","correct":"import { restRequestSync } from 'rest-assured-ts'"}],"quickstart":{"code":"import { restRequest } from 'rest-assured-ts';\n\nasync function testAPI() {\n  const response = await restRequest('https://gorest.co.in/public-api/users', {\n    headerOptions: { 'Content-Type': 'application/json' },\n    httpMethod: 'GET',\n    timeOut: 10000,\n  });\n  console.log(response.statusCode); // e.g., 200\n  console.log(response.body); // response JSON\n}\n\ntestAPI();","lang":"typescript","description":"Demonstrates basic GET request using restRequest with headers and timeout."},"warnings":[{"fix":"Use lowercase header names: 'content-type' instead of 'Content-Type'.","message":"Header names in headerOptions must be lowercase. The library does not normalize headers.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use restRequest with async/await instead.","message":"restRequestSync may be deprecated in future versions in favor of async/await.","severity":"deprecated","affected_versions":">=0.1.5"},{"fix":"Update proxy agent configuration per new docs; test existing proxy setups.","message":"Version 0.1.8 changed the default HTTP client from got to a custom implementation. Some proxy settings may break.","severity":"breaking","affected_versions":">=0.1.8"},{"fix":"Always JSON.stringify object bodies before passing to restRequest.","message":"Input body must be a string; passing a JavaScript object will cause errors.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Write explicit assertions for response structure.","message":"The library does not validate schema automatically; response validation must be done via Chai or custom code.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'activ':55 'aim':58 'api':14,68 'approach':65 'assert':38 'assur':3,7 'autom':16 'axio':74 'base':45 'chai':37,76 'code':64 'commonj':29 'cucumb':26,77 'differenti':34 'es6':30 'file':44 'file-bas':43 'got':73 'handl':47 'implicit':36 'includ':35 'inspir':18 'javascript':70 'jest':28 'json':41,49 'karat':23 'key':33 'librari':17,53 'low':63 'low-cod':62 'maintain':56 'mocha':27,75 'path':50 'postman':20,72 'provid':60 'request/response':46 'respons':42 'rest':2,6,13,67,71 'rest-assured-t':1,5 'restassur':21 'support':25,39 'test':15,69,78 'ts':4,8 'typescript':32 'typescript/javascript':12 'v0.1.8':9 'valid':51","created_at":"2026-06-07T17:00:27.927521+00:00","updated_at":"2026-06-07T17:00:27.927521+00:00","problems":[{"fix":"Wrap the call in try/catch and handle errors. Check timeout and network connectivity.","cause":"restRequest returned undefined because the request timed out or threw an error that was not caught.","error":"TypeError: Cannot read property 'statusCode' of undefined"},{"fix":"Verify the API URL. Check network connectivity and proxy configuration.","cause":"DNS lookup failed for the API host.","error":"Error: getaddrinfo ENOTFOUND example.com"},{"fix":"Check the JSON path expression and expected value in the test data.","cause":"Implicit Chai assertion failed due to mismatched JSON path or expected value.","error":"ChaiAssertionError: expected false to be true"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/automatekitbox/cucumber-rest-assured-typescript#readme","github":"https://github.com/automatekitbox/cucumber-rest-assured-typescript","docs":null,"changelog":null,"pypi":null,"npm":"rest-assured-ts","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}