ember-cli-fauxjax
v0.0.1
Published
Simple wrapper for fauxjax
Downloads
1
Maintainers
Readme
ember-cli-fauxjax
Simple wrapper for fauxjax.js
Installation
ember install:addon ember-cli-fauxjax
Setup
You can then import fauxjax in your tests:
import fauxjax from 'ember-cli-fauxjax';
GET request
var faux = fauxjax()
var json = [1, 2];
faux.GET('/faux-request', json);
POST request
var faux = fauxjax()
var json = {success: true};
var options = {data: {a: 'b'}, json: json};
faux.POST('/faux-request', options);
Setting defaults
var faux = fauxjax({status: 201})
var json = {success: true};
faux.POST('/faux-request', json);
Clear All Fauxjax Handlers
var faux = fauxjax()
faux.clear()
Remove a Single Fauxjax Handler
var faux = fauxjax()
var id = faux.GET('/faux-request', [1, 2]);
faux.remove(id)
see: JarrodCTaylor/fauxjax for fauxjax docs