Releases: adopted-ember-addons/ember-data-factory-guy
Releases · adopted-ember-addons/ember-data-factory-guy
v2.11.4
v2.11.3
-fixed to correctly recognize the new environment settings for factoryGuy:
//=> file: config/environment.js
if (environment === 'development') {
ENV.factoryGuy = { useScenarios: true };
...
}
- fixed long standing issue where component unit tests were blowing up if you were using modelFragments
- changed to detect fragments during fixture build time ( super lazy in other words )
v2.11.1
- Adds
makeNew
function to list of FactoryGuy methods that Scenario class proxies
v2.11.0
- bumped to ember-data 2.11
- Fixed urlForQueryRecord, urlForQuery to receive the query params in the mockQuery/mockQueryRequest
NOTE: A few breaking changes are in this release
1 - mockCreate and mockUpdate now require attrs key
-
is more consistent with how the GET request mocks work
Where you used to do this:
mockCreate('user').returns({name: 'Flip'});
mockUpdate('user').returns({name: 'Flip'});
Now do this:
mockCreate('user').returns({attrs: {name: 'Flip'}});
mockUpdate('user').returns(attrs: {name: 'Flip'}});
2 - The factory guy settings in the environment file changed
Where you used to do this:
ENV.factoryGuy = true;
Now you do this:
// file config/envrionment.js
ENV.factoryGuy = {useScenarios: true};
// or
ENV.factoryGuy = {enabled: false};
The default for test/development environment is:
ENV.factoryGuy = {enabled: true, useScenarios: false};
The default for production environment is:
ENV.factoryGuy = {enabled: false, useScenarios: false};
NOTE: If you set useScenarios: true enabled is automatically true
v2.10.1
- fixed so tests can be run in development mode
- fixed drf adapter not loading in fixture builder factory
- Can now make new records as if you were doing store.createRecord(modelName, attributes)
- use the new
makeNew()
function - api is same as make or build
- use the new
Usage:
let newCat = makeNew('cat', 'calico', {name: 'Meow'});
newCat.get('isNew'); //=> true
v2.10.0
v2.9.8
v2.9.7
v2.9.5
- fluffing the pillows