Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 586 Bytes

README.md

File metadata and controls

37 lines (28 loc) · 586 Bytes

Faux

Faking Ajax calls

Installation

bower install https://github.com/satisfaction/faux.git

Usage

Mocking an Ajax Call

var mock = faux.get(/\/conversations\/search/).success(200, {
  total: 1,
  total_pages: 1,
  current_page: 1,
  models: [{
    created_at: '2014-10-09T02:38:27Z',
    title: 'Lorem ipsum dolor sit amet',
    description: 'Nullam vitae diam scelerisque augue pharetra ultrices.'
  }]
});

Removing a Mock

mock.restore();

Simulating Network Latency

mock.delay(1000); // 1 second