# Introduction

## ![](https://4115553920-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-RfV58soRdBGcVkpSF%2F-M-RfWKxtjzRNqtHplVi%2F-M-RfWdecutzQ0EZemPw%2Ffrisbyjs.png?generation=1581029138563311\&alt=media)

### Frisby.js - The Easiest REST API Testing Framework Out There

Frisby makes REST API testing easy, fast, and fun. Frisby.js comes loaded with many built-in tools for the most common things you need to test for to ensure your REST API is working as it should, and returning the correct properties, values, and types.

When you need something custom, Frisby.js also provides an easy way to customize and extend assertions to make your job easier, with less repetitive and tedious code.

### A Simple Example

The most basic check of ensuring a URL returns a specific status code:

```
const frisby = require('frisby');

it ('should return a status of 200', function () {
  return frisby
    .get('http://api.example.com')
    .expect('status', 200);
});
```

### Checking a JSON Response Body

A more useful and thorough test might make several assertions on the actual JSON response. Frisby.js makes this easy:

```
const frisby = require('frisby');
const Joi = frisby.Joi; // Frisby exports Joi for convenience on type assersions


it ('should return a status of 200', function () {
  return frisby
    .get('https://jsonfeed.org/feed.json')
    .expect('status', 200)
    .expect('json', 'version', 'https://jsonfeed.org/version/1')
    .expect('json', 'title', 'JSON Feed')
    .expect('jsonTypes', 'items.*', { // Assert *each* object in 'items' array
      'id': Joi.string().required(),
      'url': Joi.string().uri().required(),
      'title': Joi.string().required(),
      'date_published': Joi.date().iso().required(),
    });
});
```

### Gain Confidence In Your API

Check out the [Getting Started](https://docs.frisbyjs.com/introduction/installation) page to setup Frisby.js in your project.

Happy testing!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.frisbyjs.com/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
