Skip to content

Commit

Permalink
setup mirage
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfiredrill committed Jan 5, 2020
1 parent 2f175b0 commit 1e5d784
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 3 deletions.
26 changes: 26 additions & 0 deletions mirage/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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');
https://www.ember-cli-mirage.com/docs/route-handlers/shorthands
*/
}
9 changes: 9 additions & 0 deletions mirage/scenarios/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function(/* server */) {

/*
Seed your development database using your factories.
This data will not be loaded in your tests.
*/

// server.createList('post', 10);
}
4 changes: 4 additions & 0 deletions mirage/serializers/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { JSONAPISerializer } from 'ember-cli-mirage';

export default JSONAPISerializer.extend({
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"ember-auto-import": "1.2.18",
"ember-cli": "~3.12.0",
"ember-cli-dependency-lint": "^1.1.3",
"ember-cli-mirage": "^1.1.6",
"ember-cli-moment-shim": "^3.7.1",
"ember-cli-pagination": "^3.1.3",
"ember-cli-template-lint": "^1.0.0-beta.1",
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/components/podcasts-search-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { setupMirage } from 'ember-cli-mirage/test-support';

module('Integration | Component | podcasts search', function(hooks) {
setupRenderingTest(hooks);
setupMirage(hooks);

test('it renders', async function(assert) {

Expand Down
Loading

0 comments on commit 1e5d784

Please sign in to comment.