Questions tagged [ember-cli-mirage]

Ember CLI Mirage is a mock server that lets you easily mock a JSON API.

Ember CLI Mirage is a mock server that lets you easily mock a JSON API. Factories and fixtures can be defined. It allows for pass-through to an existing API, making it useful for developing new features.

See the homepage, and on github.

168 questions
2
votes
1 answer

Place to put assets for dev/test in emberjs

I'm using mirage to mock some data and I'd like to mock an with the appropriate file. The problem is that I will have to place the image in /public/assets and the images placed there will be deployed later on as well. Is there a way to avoid…
renno
  • 2,659
  • 2
  • 27
  • 58
2
votes
1 answer

Ember cli mirage error: patch handler cannot read property update of null

I am using ember cli mirage with my amber app, i have data defined in fixtures and using the RestSerializer, i am trying to simulate updating the attributes of a record but getting an error: The patch handler for the url api/survey-groups/[id] threw…
Musimire
  • 43
  • 1
  • 4
2
votes
1 answer

Computed properties in Ember data models not available from ember-cli-mirage models

I try to use ember-cli-mirage for tests purposes. I have a lot of Ember data models with computed properties. When i'm creating a Mirage model instance, it seems that computed properties are not available. I was wondering if i'm making something…
ThomasDurin
  • 1,943
  • 2
  • 14
  • 20
2
votes
1 answer

'this' undefined only from component integration test

This is an Ember component that will need this at some point: export default Component.extend({ filteredSubs: computed.filter('model.subs', function() { // this will always return true in development http://localhost:4200/dummy // but will…
Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
2
votes
2 answers

Mirage `passthrough` is not working

I'm trying to use passthrough for a POST request in this Ember project this.passthrough('/thirdeye/entity?entityType=ANOMALY_FUNCTION'); This is what the call looks like in app/mirage/config.js. I got the following error: Mirage: Your Ember app…
johnwj
  • 449
  • 1
  • 7
  • 16
2
votes
0 answers

Mock many-to-many relationship using Ember CLI Mirage

Apologies in advance: I am new to both Ember (2.2.0) and Mirage, and I am tasked with creating acceptance tests for an existing Ember application. My challenge is in using Mirage (0.1.13) and fixtures (not factories) to mock existing one-to-many or…
2
votes
0 answers

Synchronous Requests to Ember Mirage

I'm having a frustrating time, and I'm not sure if it's Ember Mirage causing the problem or not. I have the following code in a service. Ember.$.get({ url: `/api/online-courses/${Ember.get(course, 'id')}/courseData`, async:…
JonRed
  • 2,853
  • 5
  • 28
  • 37
2
votes
1 answer

Ember data from Mirage fails to display on index.hbs

Ember novice here. I have been following along with the tutorial on the Ember website here. I have been R&D'ing the example to the word and everything works...until I try implementing Mirage. The data just never shows up on the index.hbs…
Auzy
  • 2,135
  • 2
  • 25
  • 35
2
votes
1 answer

Ember Mirage persist data

Currently, when I delete or change some records (model), I can see HTTP requests that intercepted by Mirage, and data on page really changes. But after page reload - it returns back. Is it possible to configure Mirage somehow to avoid rollback data…
Alex Ivasyuv
  • 8,585
  • 17
  • 72
  • 90
2
votes
2 answers

Ember-CLI-Mirage enforcing JSON:API?

Stumped on a couple failures and want to know if I'm understanding Mirage correctly: 1.In ember-cli-mirage, am I correct that the server response I define should reflect what my actual server is returning? For example: this.get('/athletes',…
Jim
  • 400
  • 4
  • 17
2
votes
1 answer

ember-cli-mirage testing request params

I have default params that are added to the search request from a route. I would like to test these in ember-cli-mirage but am stuck on how to capture the request or requestBody so that I can assert against it. Was looking for something similar to…
Jim
  • 400
  • 4
  • 17
2
votes
1 answer

Basic Ember app not working with default adapter

Here is the source code. I'm running Ember-CLI from the master branch of the git repo (currently version 2.2.0-beta.1-master-e803ac7fa6) and linking via npm. This should be using versions 2.2.0 of Ember and Ember Data. In the middle of the basic…
0dyss3us
  • 91
  • 1
  • 6
2
votes
1 answer

queryRecord returns a class object instead of the record I expect

I'm using ember-cli-mirage to stub out the API, in the config I have this this.get('/users',function(db,request){ if(request.queryParams.short_url){ var short_url = request.queryParams.short_url; return db.users.where({short_url:…
Jordan
  • 2,393
  • 4
  • 30
  • 60
2
votes
1 answer

Ember destroyRecord (or deleteRecord then save) using ember-cli-mirage failing

What I'm trying to do is integrate ember-cli-mirage into this todo app, https://github.com/ember-cli/ember-cli-todos. This app uses Ember 2.0 or greater. The setup: Clone the todo app, then cd into the app directory. shell> npm install shell> bower…
2
votes
1 answer

Test model persistence in Ember.js acceptance test

I'm trying to write an acceptance test which verifies that my signup form saves the User model to the store. I'm using Ember 1.13.6, Mocha, Chai and Ember CLI Mirage (to fake the backend for tests.) The backend is JSONAPI. I'm very new to ember and…
max
  • 96,212
  • 14
  • 104
  • 165
1
2
3
11 12