當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript TestContext.not方法代碼示例

本文整理匯總了TypeScript中ava.TestContext.not方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TestContext.not方法的具體用法?TypeScript TestContext.not怎麽用?TypeScript TestContext.not使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ava.TestContext的用法示例。


在下文中一共展示了TestContext.not方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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:

 anyValues.forEach((valueKey) => {
   t.not(data[valueKey], undefined, `on_session: ${valueKey} is undefined! => data: ${JSON.stringify(data)}`);
 });
開發者ID:OneSignal,項目名稱:OneSignal-Website-SDK,代碼行數:3,代碼來源:onSession.ts


注:本文中的ava.TestContext.not方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。