<commit_before># jasmine-http-server-spy [![Build Status](https://drone.io/bitbucket.org/atlassian/jasmine-http-server-spy/status.png)](https://drone.io/bitbucket.org/atlassian/jasmine-http-server-spy/latest)

> Creates jasmine spy objects backed by a http server. Designed to help you write integration tests where your code 
makes real http requests to a server, where the server is controlled via the familiar jasmine spy api.
  
 
## Install

```
$ npm install --save jasmine-http-server-spy
```

## Usage

```javascript
var jasmineHttpServerSpy = require('jasmine-http-server-spy');

describe('Test', function() {
  beforeAll(function(done) {
    this.httpSpy = jasmineHttpServerSpy.createSpyObj('mockServer', [
      {
        method: 'get',
        url: '/some-url-to-mock',
        handlerName: 'getSomeUrlToMock'
      }
    ]);
    return this.httpSpy.server.start(8082, done);
  });
  
  afterAll(function(done) {
    this.httpSpy.server.stop(done);
  });
  
  afterEach(function(done) {
    this.httpSpy.getSomeUrlToMock.calls.reset();
  });<commit_msg>Updated README to use promises<commit_after># jasmine-http-server-spy [![Build Status](https://drone.io/bitbucket.org/atlassian/jasmine-http-server-spy/status.png)](https://drone.io/bitbucket.org/atlassian/jasmine-http-server-spy/latest)

> Creates jasmine spy objects backed by a http server. Designed to help you write integration tests where your code 
makes real http requests to a server, where the server is controlled via the familiar jasmine spy api.
  
 
## Install

```
$ npm install --save jasmine-http-server-spy
```

## Usage

```javascript
var jasmineHttpServerSpy = require('jasmine-http-server-spy');

describe('Test', function() {
  beforeAll(function(done) {
    this.httpSpy = jasmineHttpServerSpy.createSpyObj('mockServer', [
      {
        method: 'get',
        url: '/some-url-to-mock',
        handlerName: 'getSomeUrlToMock'
      }
    ]);
    this.httpSpy.server.start(8082).then(done, done.fail);
  });
  
  afterAll(function(done) {
    this.httpSpy.server.stop().then(done, done.fail);
  });
  
  afterEach(function() {
    this.httpSpy.getSomeUrlToMock.calls.reset();
  });
{'fraction_non_alphanumeric': 0.14147465437788018, 'fraction_numerical': 0.003686635944700461, 'mean_word_length': 3.75054704595186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5336711', 'n_tokens_mistral': 757, 'n_tokens_neox': 718, 'n_words': 142}