---
id: 587d824e367417b2b2512c58
title: Run Functional Tests on API Endpoints using Chai-HTTP
challengeType: 2
videoUrl: ''
localeTitle: Ejecutar pruebas funcionales en puntos finales de API utilizando Chai-HTTP
---
## Description
Como recordatorio, este proyecto se está construyendo sobre el siguiente proyecto de inicio en Glitch , o clonado desde GitHub . Reemplace assert.fail (). Probar el estado y la text.response. Hacer pasar la prueba. No envíe un nombre en la consulta, el punto final responde con 'hola invitado'.
## Instructions
## Tests
```yml
tests:
- text: Todas las pruebas deben pasar
testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=0").then(data => { assert.equal(data.state,"passed"); }, xhr => { throw new Error(xhr.responseText); })'
- text: Debes probar para 'res.status' == 200
testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=0").then(data => { assert.equal(data.assertions[0].method, "equal"); assert.equal(data.assertions[0].args[0], "res.status"); assert.equal(data.assertions[0].args[1], "200");}, xhr => { throw new Error(xhr.responseText); })'
- text: Debes probar para 'res.text' == 'hello Guest'
testString: 'getUserInput => $.get(getUserInput("url") + "/_api/get-tests?type=functional&n=0").then(data => { assert.equal(data.assertions[1].method, "equal"); assert.equal(data.assertions[1].args[0], "res.text"); assert.equal(data.assertions[1].args[1], "\"hello Guest\"");}, xhr => { throw new Error(xhr.responseText); })'
```
## Challenge Seed
## Solution
```js
// solution required
```