mardi 31 janvier 2017

Ember Mirage: faker output reuse in record creation

I wish to mock a rather poor API that has fields which repeat the data, so I'm trying to create a Mirage Factory to generate some random data

e.g

import { Factory, faker } from 'ember-cli-mirage';

export default Factory.extend({
  "firstName": function () {
    return faker.name.firstName();
  },
  "lastName": function () {
    return faker.name.lastName();
  },
  "fullName": function () {
    // how do I put firstName + lastName here?
  }
});




Aucun commentaire:

Enregistrer un commentaire