本文整理汇总了TypeScript中ember-qunit.setupTest函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setupTest函数的具体用法?TypeScript setupTest怎么用?TypeScript setupTest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setupTest函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: module
module('Unit | Service | identity', function(hooks) {
setupTest(hooks);
skip('can dump and reload', async function(assert) {
assert.expect(0);
});
});
示例2: module
module('Unit | Route | chat', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let route = this.owner.lookup('route:chat');
assert.ok(route);
});
});
示例3: module
module('Unit | Service | redirect-manager', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let service = this.owner.lookup('service:redirect-manager');
assert.ok(service);
});
});
示例4: module
module('Unit | Controller | datasets/dataset/compliance', function(hooks): void {
setupTest(hooks);
test('it exists', function(assert): void {
let controller = this.owner.lookup('controller:datasets/dataset/compliance');
assert.ok(controller);
assert.ok(typeof controller.fieldFilter === 'undefined', 'fieldFilter queryParam binding is undefined');
});
});
示例5: module
module('Unit | Model | user', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('user', {});
assert.ok(model);
});
});
示例6: module
module('Unit | Service | messages/auto-responder', function(hooks) {
setupTest(hooks);
setupCurrentUser(hooks);
clearLocalStorage(hooks);
test('it exists', function(assert) {
let service = getService<AutoResponder>('messages/auto-responder');
assert.ok(service);
});
module('cameOnline', function() {
module('handling messages queued for resend', function() {
module('there are no pending messages', function(hooks) {
hooks.beforeEach(async function(assert) {
const store = getService<StoreService>('store');
const messages = await store.findAll('message');
assert.equal(messages.length, 0, 'there are no messages');
});
test('no messages are sent', async function(assert) {
assert.expect(1);
const service = getService<AutoResponder>('messages/auto-responder');
const somePerson = await createContact('some person');
stubService('messages/dispatcher', {
sendToUser: {
perform(/* _response: Message, _to: Identity */) {
assert.ok(false, 'this method should not get called');
},
},
});
service.cameOnline(somePerson);
});
});
module('there are pending messages', function(hooks) {
let somePerson: Identity;
let service: AutoResponder;
hooks.beforeEach(async function(assert) {
service = getService<AutoResponder>('messages/auto-responder');
somePerson = await createContact('some person');
const store = getService<StoreService>('store');
const me = getService<CurrentUserService>('currentUser');
let messages = await store.findAll('message');
assert.equal(messages.length, 0, 'there are no messages');
await store
.createRecord('message', {
to: somePerson.uid,
queueForResend: true,
sender: me.record,
})
.save();
await store
.createRecord('message', {
to: somePerson.uid,
queueForResend: true,
sender: me.record,
})
.save();
messages = await store.findAll('message');
assert.equal(messages.length, 2, 'there are 2 messages');
const pendingMessages = await store.query('message', {
queueForResend: true,
to: somePerson.uid,
});
assert.equal(pendingMessages.length, 2, 'there are 2 pending messages');
});
test('there are no longer any queued messages', async function(assert) {
assert.expect(6);
stubService('messages/dispatcher', {
sendToUser: {
perform(_response: Message, to: Identity) {
assert.equal(to.uid, somePerson.uid, `message sent to: ${somePerson.name}`);
},
},
});
await service.cameOnline(somePerson);
const store = getService<StoreService>('store');
await waitUntilTruthy(async () => {
let messages = await store.query('message', {
queueForResend: true,
to: somePerson.uid,
});
return messages.length === 0;
//.........这里部分代码省略.........
示例7: module
module('engine foo component', function(hooks) {
setupTest(hooks, {
resolver: Ember.Resolver.create()
});
});