本文整理汇总了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)}`);
});
}
示例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)}`);
});
}
示例3:
anyValues.forEach((valueKey) => {
t.not(data[valueKey], undefined, `on_session: ${valueKey} is undefined! => data: ${JSON.stringify(data)}`);
});