当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript helpers.getStore函数代码示例

本文整理汇总了TypeScript中emberclear/tests/helpers.getStore函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getStore函数的具体用法?TypeScript getStore怎么用?TypeScript getStore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getStore函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: test

  test('a new user is created and stored', async function(assert) {
    const before = await getStore().findAll('user');

    assert.equal(before.length, 0);

    await createCurrentUser();

    const after = await getStore().findAll('user');

    assert.equal(after.length, 1);
    assert.equal(after.toArray()[0].id, 'me');
  });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:12,代码来源:create-current-user-test.ts

示例2: test

      test('the message is saved', async function(assert) {
        const store = getStore();
        const service = getService<ReceivedMessageHandler>('messages/handler');
        const me = getService<CurrentUserService>('currentUser');
        const sender = await attributesForContact();

        const before = await store.findAll('message');
        const beforeCount = before.toArray().length;

        await service.handle({
          id: uuid(),
          type: TYPE.CHAT,
          target: TARGET.WHISPER,
          to: me.record!.uid,
          ['time_sent']: new Date(),
          client: 'tests',
          ['client_version']: '0',
          sender: {
            uid: sender.id,
            name: `user with id: ${sender.id}`,
            location: '',
          },
          message: {
            body: 'malformed, cleartext body',
            contentType: 'is this used?',
          },
        });

        const after = await store.findAll('message');

        assert.equal(after.length, beforeCount + 1);
      });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:32,代码来源:unit-test.ts

示例3: test

      test('sets the "me" identity', function(assert) {
        const store = getStore();
        const known = store.peekAll('user');

        assert.equal(known.length, 1);
        assert.equal(known.toArray()[0].id, 'me');
      });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:7,代码来源:acceptance-test.ts

示例4: function

      hooks.beforeEach(async function(assert) {
        const store = getStore();

        await store.createRecord('message', {}).save();
        await store.createRecord('message', {}).save();

        const messages = await store.findAll('message');

        assert.equal(messages.length, 2);
      });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:10,代码来源:acceptance-test.ts

示例5: test

    test('there are 0 channels', async function(assert) {
      const store = getStore();
      const known = await store.findAll('channel');

      assert.equal(known.length, 0);
    });
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:6,代码来源:acceptance-test.ts


注:本文中的emberclear/tests/helpers.getStore函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。