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


TypeScript assert.deepStrictEqual函數代碼示例

本文整理匯總了TypeScript中assert.deepStrictEqual函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript deepStrictEqual函數的具體用法?TypeScript deepStrictEqual怎麽用?TypeScript deepStrictEqual使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了deepStrictEqual函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('returns an empty list for closed ranges', async function() {
   const result = await getOpsBoth(this.store, ['a', 'b', 'c', 'd'], sparseSV(this.source, this.store, {from:this.v1, to:this.v1}))
   // TODO: I'm not sure if this should return [from:v1, to:v1] or just [].
   assert.deepStrictEqual(result, {ops:[], versions: [{from:this.v1, to:this.v1}]})
 })
開發者ID:josephg,項目名稱:statecraft,代碼行數:5,代碼來源:common.ts

示例2: it

 it("should have values [16909060]", () => {
     assert.deepStrictEqual(TestRecord.values(record), [16909060])
 })
開發者ID:mysticatea,項目名稱:bre,代碼行數:3,代碼來源:uint32.ts

示例3: it

 it("should have keys [a]", () => {
     assert.deepStrictEqual(TestRecord.keys(record), ["a"])
 })
開發者ID:mysticatea,項目名稱:bre,代碼行數:3,代碼來源:int16.ts

示例4: it

 it('expected index sequence', function () {
     assert.deepStrictEqual(indexSeq, [0, 1, 2]);
 });
開發者ID:saneyuki,項目名稱:karen,代碼行數:3,代碼來源:test_flatMap.ts

示例5: it

 it("should have entries [[a,0], [b,0]]", () => {
     assert.deepStrictEqual(TestRecord.entries(record), [
         ["a", 0],
         ["b", 0],
     ])
 })
開發者ID:mysticatea,項目名稱:bre,代碼行數:6,代碼來源:bit1.ts

示例6:

 return service.find({ query: { test: true } }).then((res: any) =>
   assert.deepStrictEqual(res, {
     params: { test: true }
   })
開發者ID:feathersjs,項目名稱:feathers,代碼行數:4,代碼來源:client.test.ts

示例7: assert

import * as timers from "timers";

// Specifically test buffer module regression.
import {Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer} from "buffer";

//////////////////////////////////////////////////////////
/// Assert Tests : https://nodejs.org/api/assert.html ///
//////////////////////////////////////////////////////////

namespace assert_tests {
    {
        assert(1 + 1 - 2 === 0, "The universe isn't how it should.");

        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");
開發者ID:hongshanzhu,項目名稱:DefinitelyTyped,代碼行數:31,代碼來源:node-tests.ts


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