本文整理汇总了TypeScript中chai.assert.notOk方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.notOk方法的具体用法?TypeScript assert.notOk怎么用?TypeScript assert.notOk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.notOk方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('can compile a number matcher', () => {
let match = compileMatcher(3);
let ctx = new Context();
assert.ok(match(3, ctx));
assert.notOk(match(1, ctx));
assert.notOk(match('3', ctx));
});
示例2: it
it("should delete data without a callback", async () => {
let result = await bucket.get(key);
assert.deepEqual(result, value);
await bucket.del(key);
result = await bucket.get(key);
assert.notOk(result);
});
示例3: it
it('exposes simple bindings', () => {
let context = new Context();
assert.ok(context.bind('foo', 1));
assert.ok(context.bind('foo', 1));
assert.notOk(context.bind('foo', 2));
assert.deepEqual(flattenPrototype(context.expose()), { foo: 1 });
});
示例4: it
it('returns nothing when the store is enough', () => {
const query = gql`
{
people_one(id: "1") {
name
}
}
`;
const result = {
people_one: {
name: 'Luke Skywalker',
},
};
const store = writeQueryToStore({
result,
query,
});
assert.notOk(diffQueryAgainstStore({
store,
query,
}).isMissing);
});
示例5: assertNoMatch
function assertNoMatch(matcher: (key: string) => Matcher, node: any) {
let context = new Context();
assert.notOk(matcher('binding')(node, context));
let env = flattenPrototype(context.expose());
assert.deepEqual(env, {});
}
示例6: it
it('attempts to establish the number of processors', () => {
assert.equal(subject.processorCount, 8);
delete global['navigator'].hardwareConcurrency;
subject = new UserEnvironment();
assert.notOk(subject.processorCount);
});