diff --git a/bower.json b/bower.json index 2138d3bcc38..40c2867e607 100644 --- a/bower.json +++ b/bower.json @@ -15,8 +15,11 @@ "moment": ">= 2.8.0", "moment-timezone": ">= 0.1.0", "normalize-css": "~3.0.3", - "pretender": "~0.10.1", + "pretender": "~1.1.0", "lodash": "~3.7.0", - "Faker": "~3.0.0" + "Faker": "~3.1.0" + }, + "resolutions": { + "FakeXMLHttpRequest": "^1.4.0" } } diff --git a/mirage/config.js b/mirage/config.js new file mode 100644 index 00000000000..5d27cd5a2e7 --- /dev/null +++ b/mirage/config.js @@ -0,0 +1,22 @@ +export default function() { + + // These comments are here to help you get started. Feel free to delete them. + + // Config (with defaults). + // + // Note: these only affect routes defined *after* them! + + // this.urlPrefix = ''; // make this `http://localhost:8080`, for example, if your API is on a different server + // this.namespace = ''; // make this `api`, for example, if your API is namespaced + // this.timing = 400; // delay for each request, automatically set to 0 during testing + + // Shorthand cheatsheet: + + // this.get('/posts'); + // this.post('/posts'); + // this.get('/posts/:id'); + // this.put('/posts/:id'); // or this.patch + // this.del('/posts/:id'); + + // http://www.ember-cli-mirage.com/docs/v0.2.x/shorthands/ +} diff --git a/mirage/scenarios/default.js b/mirage/scenarios/default.js new file mode 100644 index 00000000000..0642037dfe7 --- /dev/null +++ b/mirage/scenarios/default.js @@ -0,0 +1,9 @@ +export default function(/* server */) { + + // Seed your development database using your factories. + // This data will not be loaded in your tests. + + // Make sure to define a factory for each model you want to create. + + // server.createList('post', 10); +} diff --git a/mirage/serializers/application.js b/mirage/serializers/application.js new file mode 100644 index 00000000000..6d47a366907 --- /dev/null +++ b/mirage/serializers/application.js @@ -0,0 +1,4 @@ +import { JSONAPISerializer } from 'ember-cli-mirage'; + +export default JSONAPISerializer.extend({ +}); diff --git a/package.json b/package.json index c25fd174c6d..37574b194ca 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-ic-ajax": "1.0.0", "ember-cli-inject-live-reload": "^1.3.1", - "ember-cli-mirage": "0.1.13", + "ember-cli-mirage": "0.2.1", "ember-cli-moment-shim": "2.0.0", "ember-cli-qunit": "^2.0.0", "ember-cli-release": "0.2.8", diff --git a/tests/helpers/destroy-app.js b/tests/helpers/destroy-app.js index 13d49895012..e327b18fcba 100644 --- a/tests/helpers/destroy-app.js +++ b/tests/helpers/destroy-app.js @@ -2,4 +2,5 @@ import Ember from 'ember'; export default function destroyApp(application) { Ember.run(application, 'destroy'); + server.shutdown(); }