本文整理汇总了TypeScript中ember-qunit.moduleForModel函数的典型用法代码示例。如果您正苦于以下问题:TypeScript moduleForModel函数的具体用法?TypeScript moduleForModel怎么用?TypeScript moduleForModel使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了moduleForModel函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: moduleForComponent
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
import { test, skip, moduleFor, moduleForModel, moduleForComponent, setResolver } from 'ember-qunit';
moduleForComponent('x-foo', {
integration: true
});
moduleForComponent('x-foo', {
unit: true,
needs: ['helper:pluralize-string']
});
moduleForModel('user', {
needs: ['model:child']
});
moduleFor('controller:home');
moduleFor('component:x-foo', 'Some description');
moduleFor('component:x-foo', 'TestModule callbacks', {
beforeSetup() {
},
beforeEach(assert) {
this.registry.register('helper:i18n', {});
this.register('service:i18n', {});
this.inject.service('i18n');
this.inject.service('i18n', { as: 'i18n' });
this.factory('object:user').create();
示例2: moduleForModel
import { moduleForModel, test } from 'ember-qunit';
import { withChai } from 'ember-cli-chai/qunit';
import { make, manualSetup } from 'ember-data-factory-guy';
import moment from 'moment';
moduleForModel('event', 'Unit |Model | event', {
needs: [
'model:opening-tier',
'model:pricing-tier',
'model:package',
'model:level',
'model:competition',
'model:line-item',
'model:shirt',
'model:custom-field',
'model:sponsorship',
'model:registration',
'model:integration'
],
beforeEach() {
manualSetup(this.container);
}
});
test('#registrationIsOpen is true once registrationOpensAt is in the past', function(assert) {
const openingTier = make('opening-tier');
const event = make('event', { openingTier });
Ember.run(() => event.set('registrationOpensAt', moment().subtract(1, 'days').toDate()));