本文整理汇总了TypeScript中assert.notDeepStrictEqual函数的典型用法代码示例。如果您正苦于以下问题:TypeScript notDeepStrictEqual函数的具体用法?TypeScript notDeepStrictEqual怎么用?TypeScript notDeepStrictEqual使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了notDeepStrictEqual函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it(`decodes ${name} (${value})`, () => {
const buf: Array<number> = [];
ieee754.write(buf, value, 0, false, 52, 8);
const expected = ieee754.read(buf, 0, false, 52, 8);
assert.deepStrictEqual(decode([FLOAT64_TYPE, ...buf]), expected, "matched sign");
assert.notDeepStrictEqual(decode([FLOAT64_TYPE, ...buf]), -expected, "unmatched sign");
});
示例2:
assert.deepEqual({ x: { y: 3 } }, { x: { y: 3 } }, "DEEP WENT DERP");
assert.deepStrictEqual({ a: 1 }, { a: 1 }, "uses === comparator");
assert.doesNotThrow(() => {
const b = false;
if (b) { throw "a hammer at your face"; }
}, undefined, "What the...*crunch*");
assert.equal(3, "3", "uses == comparator");
assert.fail(1, 2, undefined, '>');
assert.ifError(0);
assert.notDeepStrictEqual({ x: { y: "3" } }, { x: { y: 3 } }, "uses !== comparator");
assert.notEqual(1, 2, "uses != comparator");
assert.notStrictEqual(2, "2", "uses === comparator");
assert.ok(true);
assert.ok(1);
assert.strictEqual(1, 1, "uses === comparator");
assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT");
}
}
////////////////////////////////////////////////////