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


TypeScript assert.called方法代码示例

本文整理汇总了TypeScript中Sinon.assert.called方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.called方法的具体用法?TypeScript assert.called怎么用?TypeScript assert.called使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sinon.assert的用法示例。


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

示例1: test

test("test watch", () => {
  const am = genAM();
  const spy1 = sinon.spy();
  const spy2 = sinon.spy();
  am.addAttribute(genAttr(NSIdentity.fromFQN("hoge.aaa"), () => {
    spy1("watch");
  }));
  am.addAttribute(genAttr(NSIdentity.fromFQN("hoge.aaa"), () => {
    spy2("watch");
  }));
  am.watch(NSIdentity.guess("hoge.aaa"), (a, b, c) => { /*do nothing*/ });
  sinon.assert.called(spy1);
  sinon.assert.called(spy2);
});
开发者ID:emadurandal,项目名称:GrimoireJS,代码行数:14,代码来源:AttributeManagerTest.ts

示例2: test

    test('calls indices.delete', async () => {
      const callCluster = sinon.spy(async (path: string, { index }: any) => {
        expect(path).toEqual('indices.delete');
        expect(index).toEqual('.lotr');
      });

      await Index.deleteIndex(callCluster, '.lotr');
      sinon.assert.called(callCluster);
    });
开发者ID:liuyepiaoxiang,项目名称:kibana,代码行数:9,代码来源:elastic_index.test.ts

示例3: test

    test('calls indices.create', async () => {
      const callCluster = sinon.spy(async (path: string, { body, index }: any) => {
        expect(path).toEqual('indices.create');
        expect(body).toEqual({ mappings: { foo: 'bar' } });
        expect(index).toEqual('.abcd');
      });

      await Index.createIndex(callCluster, '.abcd', { foo: 'bar' } as any);
      sinon.assert.called(callCluster);
    });
开发者ID:salihkardan,项目名称:kibana,代码行数:10,代码来源:elastic_index.test.ts

示例4: test

test("Broadcast message with range should work correctly", (t) => {
  const testNode3 = rootNode.children[0];
  resetSpies();
  testNode3.enabled = true;
  rootNode.broadcastMessage(1, "onTest");
  sinon.assert.called(testComponent3Spy);
  sinon.assert.notCalled(testComponent2Spy);
  sinon.assert.notCalled(testComponentOptionalSpy);
  sinon.assert.notCalled(testComponent1Spy);
});
开发者ID:emadurandal,项目名称:GrimoireJS,代码行数:10,代码来源:GomlNode2Test.ts

示例5: test

    test('it calls indices.putMapping', async () => {
      const callCluster = sinon.spy(async (path: string, { body, type, index }: any) => {
        expect(path).toEqual('indices.putMapping');
        expect(index).toEqual('.shazm');
        expect(body).toEqual({
          dynamic: 'strict',
          properties: {
            foo: 'bar',
          },
        });
      });

      await Index.putMappings(callCluster, '.shazm', {
        dynamic: 'strict',
        properties: {
          foo: 'bar',
        },
      });

      sinon.assert.called(callCluster);
    });
开发者ID:lucabelluccini,项目名称:kibana,代码行数:21,代码来源:elastic_index.test.ts

示例6: it

 it("enableCircularCheck option is true", () => {
     const result = plainToClass<User, Object>(User, user, { enableCircularCheck: true }); 
     sinon.assert.called(isCircularSpy);
 });
开发者ID:MagnusCloudCorp,项目名称:class-transformer,代码行数:4,代码来源:circular-reference-problem.spec.ts

示例7: setTimeout

 setTimeout(() => {
   sinon.assert.called(postStub);
 }, ReportingLoopIntervalInMs + 100);
开发者ID:drvegass,项目名称:telemetry,代码行数:3,代码来源:index.spec.ts


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