# agile-proxy-client

> Javascript client (browser based) for agile-proxy server

Latest version **0.0.7** (published 2015-02-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install agile-proxy-client
pnpm add agile-proxy-client
yarn add agile-proxy-client
bun add agile-proxy-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2015-02-21 |
| First published | 2014-12-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | gary.taylor |

## Links

- npm: https://www.npmjs.com/package/agile-proxy-client
- npm.io page: https://npm.io/package/agile-proxy-client

## Dependencies (6)

- [nock](https://npm.io/package/nock.md) ^0.52.4
- [sinon](https://npm.io/package/sinon.md) ^1.12.2
- [string](https://npm.io/package/string.md) ^3.0.0
- [request](https://npm.io/package/request.md) ^2.51.0
- [amdefine](https://npm.io/package/amdefine.md) ^0.1.0
- [underscore](https://npm.io/package/underscore.md) ^1.7.0

## Recent versions

- 0.0.7 (latest) — 2015-02-21
- 0.0.6 — 2015-02-21
- 0.0.5 — 2015-01-29
- 0.0.4 — 2015-01-28
- 0.0.3 — 2014-12-31
- 0.0.1 — 2014-12-31

## README

Agile Proxy Client
==================

[![Build Status](https://travis-ci.org/garytaylor/agile-proxy-client.svg?branch=master)](https://travis-ci.org/garytaylor/agile-proxy-client)

A browser or nodejs based client to access an agile-proxy (https://github.com/garytaylor/agileproxy) server in tests etc..

## Overview

If you are not familiar with agile-proxy, please see (https://github.com/garytaylor/agileproxy) to find out more.  In summary, it allows stubbing of HTTP requests even across processes such as selenium or other in browser test suites.

This is a client 'driver' for use within your tests which can do various tasks such as :-
* Add HTTP stubs with associated responses

Future functionality includes:
* Tracking of which http stubs have been requested by the application under test.

## Example

The code below uses jasmine, but this could be just as easily applied to others.

```javascript
  beforeEach(function (done) {
    proxy = new AgileProxy.Proxy();
    proxy.config({
                    proxyUrl: '',
                    restUrl: 'http://localhost:3020'
                });
    proxy.define(function (p) {
      p.stub('http://www.google.com', {method: 'GET'}).andReturn({text: 'I am not google'});
      p.stub('http://mydomain.com/users', {method: 'POST'}).andReturn({json: {name: 'Test User', id: 10}});
    }, function () {
      done()
    });
  });
  it('Should do something', function () {
    // Code which drives a browser for example to fetch 'http://www.google.com'
    //it should get back 'I am not google'
  });

```

## History
0.0.1 - Initial release to github
0.0.2 - Integrated travis
0.0.3 - Released to npm and bower
0.0.6 - Added support for recordings api via the stub
0.0.7 - Added support for 'recordRequests' in stub definition

---
_Source: https://npm.io/package/agile-proxy-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
