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


TypeScript assert.strict函數代碼示例

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


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

示例1: function

 blockchain.getAddressTransactions(options, function(err, result) {
   assert.equal(err, null);
   assert.equal(Array.isArray(result.transactions), true);
   assert.equal(result.start, 0);
   result.should.have.property('total');
   result.should.have.property('count');
   assert(result.transactions.length > 20);
   assert.equal(result.transactions.length, result.count);
   assert(result.total > 75);
   done();
 });
開發者ID:BitGo,項目名稱:BitGoJS,代碼行數:11,代碼來源:blockchain.ts

示例2: function

          bitgo.keychains().createBitGo({}, function(err, keychain) {
            assert(keychain.xpub);
            keychains.push(keychain);

            const options = {
              label: 'my wallet',
              m: 2,
              n: 3,
              keychains: keychains.map(function(k) { return { xpub: k.xpub }; })
            };
            wallets.add(options, function(err, wallet) {
              assert.equal(err, null);
              testWallet = wallet;

              assert.equal(wallet.balance(), 0);
              assert.equal(wallet.label(), 'my wallet');
              assert.equal(wallet.confirmedBalance(), 0);
              assert.equal(wallet.keychains.length, 3);
              assert.equal(bitgo.keychains().isValid({ key: wallet.keychains[0].xpub }), true);
              assert.equal(bitgo.keychains().isValid({ key: wallet.keychains[1].xpub }), true);
              assert.equal(bitgo.keychains().isValid({ key: wallet.keychains[2].xpub }), true);
              assert.equal(wallet.keychains[0].xpub, keychains[0].xpub);
              assert.equal(wallet.keychains[1].xpub, keychains[1].xpub);
              done();
            });
          });
開發者ID:BitGo,項目名稱:BitGoJS,代碼行數:26,代碼來源:wallets.ts

示例3: constructor

  constructor(semester: Semester, academicYear: string = config.academicYear) {
    assert(validateSemester(semester), `${semester} is not a valid semester`);

    super(academicYear);

    this.semester = semester;
    this.academicYear = academicYear;
    this.outputCache = this.getCache<Output>(`semester-${semester}-module-data`);
    this.logger = this.rootLogger.child({
      semester,
      year: academicYear,
      task: GetSemesterData.name,
    });
  }
開發者ID:nusmodifications,項目名稱:nusmods,代碼行數:14,代碼來源:GetSemesterData.ts

示例4: constructor

  constructor(semester: Semester, academicYear: string = config.academicYear) {
    assert(validateSemester(semester), `${semester} is not a valid semester`);

    super(academicYear);

    this.semester = semester;
    this.academicYear = academicYear;

    this.logger = this.rootLogger.child({
      semester,
      task: GetSemesterExams.name,
      year: academicYear,
    });

    this.examCache = this.getCache<ModuleExam[]>(`semester-${semester}-exams`);
  }
開發者ID:nusmodifications,項目名稱:nusmods,代碼行數:16,代碼來源:GetSemesterExams.ts

示例5: assert

 .then(function() {
   assert(false); // should not get here
 })
開發者ID:BitGo,項目名稱:BitGoJS,代碼行數:3,代碼來源:travelRule.ts

示例6: function

 bitgo.logout({}, function(err) {
   // logout should fail when not logged in
   assert(err);
   done();
 });
開發者ID:BitGo,項目名稱:BitGoJS,代碼行數:5,代碼來源:bitgo.ts


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