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


TypeScript ts-mockito.anyString函数代码示例

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


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

示例1: it

 it('returns a promise that resolves to targetId', async () => {
   when(mockedNativeCommandsSender.popToRoot(anyString(), anyString(), anything())).thenResolve(
     'theComponentId'
   );
   const result = await uut.popToRoot('theComponentId');
   expect(result).toEqual('theComponentId');
 });
开发者ID:wix,项目名称:react-native-navigation,代码行数:7,代码来源:Commands.test.ts

示例2: beforeEach

  beforeEach(() => {
    const mockedAssetService = mock(AssetService);
    when(mockedAssetService.resolveFromRequire(anyNumber())).thenReturn({
      height: 100,
      scale: 1,
      uri: 'lol',
      width: 100
    });
    const assetService = instance(mockedAssetService);

    const mockedColorService = mock(ColorService);
    when(mockedColorService.toNativeColor(anyString())).thenReturn(666);
    const colorService = instance(mockedColorService);

    uut = new OptionsProcessor(store, new UniqueIdProvider(), colorService, assetService);
  });
开发者ID:wix,项目名称:react-native-navigation,代码行数:16,代码来源:OptionsProcessor.test.ts

示例3: mock

// Mocking configuration
let outputTopic = 'output.1_0.HelloWorldMicroservice.HelloWorld.HelloWorldResponse';
let snapshotTopic = 'snapshot.1_0.HelloWorldMicroservice.HelloWorld';
let stateName = 'stateName';
let componentCode = -69981087;
let stateMachineCode = -829536631;

let apiConfiguration: ApiConfiguration = mock(DefaultApiConfiguration);

when(apiConfiguration.getSubscriberTopic(anyNumber(), anyNumber(), anything())).thenReturn(outputTopic);

when(apiConfiguration.getSnapshotTopic(anyNumber())).thenReturn('snapshot.1_0.HelloWorldMicroservice.HelloWorld');

when(apiConfiguration.getStateName(anyNumber(), anyNumber(), anyNumber())).thenReturn(stateName);

when(apiConfiguration.getComponentCode(anyString())).thenReturn(componentCode);

when(apiConfiguration.getStateMachineCode(anyString(), anyString())).thenReturn(stateMachineCode);

// Initilisation of expected data
let correctData = {
    Header: { IncomingEventType: 0 },
    JsonMessage: JSON.stringify({ Topic: { Key: outputTopic, kind: Kinds.Public } })
};

let stateMachineId = '2';
let jsonMessage: JsonMessage = { key: 'value' };
let jsonData = {
    Header: {
        StateMachineCode: stateMachineCode,
        ComponentCode: componentCode,
开发者ID:xcomponent,项目名称:ReactiveXComponent.js,代码行数:31,代码来源:mockSubscriberDependencies.ts


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