- [email protected]
- [email protected] (latest beta)
- New App
ember new ember-ansible
- Create Models
ember g model user
ember g model feature
ember g model tag
- Create Routes
ember g route users -p
ember g route features -p
- Install Mirage (latest beta [v0.2.0-beta.9])
ember install ember-cli-mirage@beta --save-dev
ember g ember-cli-mirage
- Create Mirage Models Mirage models only define relationships.
ember g mirage-model user
ember g mirage-model feature
ember g mirage-model tag
- Create Mirage Factories Mirage factories only define attributes.
ember g mirage-factory user
ember g mirage-factory feature
ember g mirage-factory tag
- Use JSON-API Serializer
// /mirage/serializers/application.js
import { JSONAPISerializer } from 'ember-cli-mirage';
export default JSONAPISerializer.extend({
});
- Configure Default Scenario
- Run your tests!
ember t
-
Fix Model Associations in unit tests.
-
Create Features Controller
ember g controller features -p
- Create list-features component
ember g component list-features -p
- Create test-helper
bootstrap-mirage
ember g test-helper bootstrap-mirage
- Import bootstrap-mirage into list-features integration test
import startMirage from '../../../helpers/setup-mirage-for-integration';