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


TypeScript TestContext.is方法代码示例

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


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

示例1: inspectPushRecordCreationRequest

async function inspectPushRecordCreationRequest(t: TestContext, requestStub: SinonStub) {
  // For player#create device record is already serialized. Checking serialized structure.
  const anyValues = [
    "device_type",
    "language",
    "timezone",
    "device_os",
    "sdk",
    "delivery_platform",
    "browser_name",
    "browser_version",
    "operating_system",
    "operating_system_version",
    "device_platform",
    "device_model",
    "identifier",
    "notification_types"
  ];
  t.is(requestStub.callCount, 1);
  t.not(requestStub.getCall(0), null);
  const data: any = requestStub.getCall(0).args[1];
  anyValues.forEach((valueKey) => {
    t.not(data[valueKey], undefined, `player create: ${valueKey} is undefined! => data: ${JSON.stringify(data)}`);
  });
}
开发者ID:OneSignal,项目名称:OneSignal-Website-SDK,代码行数:25,代码来源:onSession.ts

示例2: inspectOnSessionRequest

async function inspectOnSessionRequest(t: TestContext, requestStub: SinonStub) {
  // Device record is serialized inside of `updateUserSession`. Checking original DeviceRecord properties.
  const anyValues = [
    "deliveryPlatform",
    "language",
    "timezone",
    "browserVersion",
    "sdkVersion",
    "browserName",
    "subscriptionState",
    "operatingSystem",
    "operatingSystemVersion",
    "devicePlatform",
    "deviceModel",
  ];
  t.is(requestStub.callCount, 1);
  t.not(requestStub.getCall(0), null);
  const data: any = requestStub.getCall(0).args[1];
  anyValues.forEach((valueKey) => {
    t.not(data[valueKey], undefined, `on_session: ${valueKey} is undefined! => data: ${JSON.stringify(data)}`);
  });
}
开发者ID:OneSignal,项目名称:OneSignal-Website-SDK,代码行数:22,代码来源:onSession.ts

示例3: testAllJoynTypeRoundTrip

// Test that an AllJoyn schema type code can be converted to a JSON schema and back.
function testAllJoynTypeRoundTrip(t: TestContext, allJoynType: string, expectedSchema: JsonSchema) {
    let schema: JsonSchema = AllJoynSchemaReader.allJoynTypeToJsonSchema(allJoynType);
    t.deepEqual(schema, expectedSchema);
    let convertedType: string = AllJoynSchemaWriter.jsonSchemaToAllJoynType(schema);
    t.is(convertedType, allJoynType);
}
开发者ID:arjun-msft,项目名称:opent2t,代码行数:7,代码来源:AllJoynSchemaTests.ts

示例4: testPktLine

function testPktLine(t : TestContext, input : string, expected : string) {
  t.is(decode(pktLine(encode(input))), expected);
}
开发者ID:strangesast,项目名称:es-git,代码行数:3,代码来源:pkt-line.test.ts

示例5: testToHexChar

function testToHexChar(t : TestContext, input : number, expected : string) {
  t.is(String.fromCharCode(toHexChar(input)), expected);
}
开发者ID:strangesast,项目名称:es-git,代码行数:3,代码来源:utils.test.ts

示例6: testUnpktLine

function testUnpktLine(t : TestContext, input : string, expected : [string, string]) {
  const [line, tail] = unpktLine(input);
  t.is(line, expected[0]);
  t.is(tail, expected[1]);
}
开发者ID:strangesast,项目名称:es-git,代码行数:5,代码来源:unpkt-line.test.ts

示例7: testFromHex

function testFromHex(t : TestContext, input : string, expected : number) {
  t.is(fromHex(input), expected);
}
开发者ID:strangesast,项目名称:es-git,代码行数:3,代码来源:unpkt-line.test.ts


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