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


TypeScript assert.doesNotThrow函數代碼示例

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


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

示例1: it

 it('should work', function (done) {
   assert.doesNotThrow(function () { 
     tableService.doesTableExist('$MetricsMinutePrimaryTransactionsBlob', function () { 
       assert.doesNotThrow(function () { 
         tableService.doesTableExist('$MetricsTransactionsTable', function () { 
           done();
         }); 
       });     
     }); 
   });      
 });
開發者ID:litek,項目名稱:azure-storage-node,代碼行數:11,代碼來源:tableservice-tests.ts

示例2: setTimeout

 next: (root: Element) => {
   const myElement = root.querySelector(
     '.myelementclass'
   ) as HTMLElement;
   assert.notStrictEqual(myElement, null);
   assert.notStrictEqual(typeof myElement, 'undefined');
   assert.strictEqual(myElement.tagName, 'H3');
   assert.doesNotThrow(function() {
     setTimeout(() => myElement.click());
   });
 },
開發者ID:ntilwalli,項目名稱:cyclejs,代碼行數:11,代碼來源:events.ts

示例3: it

 it('should return error on bad .p12 in callback', done => {
   assert.doesNotThrow(() => {
     getPem(BADP12FILE, (err, pem) => {
       assert(err);
       if (err) {
         assert(err.message.indexOf('Too few bytes to read') > -1);
         done();
       }
     });
   });
 });
開發者ID:ryanseys,項目名稱:google-p12-pem,代碼行數:11,代碼來源:index.ts

示例4: test

 test('checkConsistency accepts isolated vertices', function() {
   var f1, mesh, v0, v1, v2, v3;
   mesh = new HalfEdgeMesh;
   v0 = mesh.createVertex([0, 0, 0]);
   v1 = mesh.createVertex([1, 0, 0]);
   v2 = mesh.createVertex([1, 1, 0]);
   v3 = mesh.createVertex([0, 0, 1]);
   f1 = mesh.newFace([v0, v1, v2]);
   assert.doesNotThrow(function() {
     mesh.checkConsistency();
   });
 });
開發者ID:rmx,項目名稱:encounter,代碼行數:12,代碼來源:Navmesh.ts

示例5: setTimeout

 next: (root: Element) => {
   const firstElem = root.querySelector('.first') as HTMLElement;
   const secondElem = root.querySelector('.second') as HTMLElement;
   assert.notStrictEqual(firstElem, null);
   assert.notStrictEqual(typeof firstElem, 'undefined');
   assert.notStrictEqual(secondElem, null);
   assert.notStrictEqual(typeof secondElem, 'undefined');
   assert.doesNotThrow(function() {
     setTimeout(() => firstElem.click());
     setTimeout(() => secondElem.click(), 5);
   });
 },
開發者ID:joeldentici,項目名稱:cyclejs,代碼行數:12,代碼來源:events.ts

示例6: it

    it('should throw if addNode() is invoked with already existing node', () => {
        const nodes = new Map<number, any>();
        const sortOp = new TopologicalSort<number, any>(nodes);

        assert.doesNotThrow(() => {
            sortOp.addNode(1, {});
        }, 'addNode() should not throw if nodes list is empty');

        assert.throws(() => {
            sortOp.addNode(1, {});
        }, 'addNode() should throw an error if node with this key already exists');
    });
開發者ID:1999,項目名稱:topological-sort,代碼行數:12,代碼來源:index.spec.ts

示例7: it

 it('should not error if only refresh token is set', () => {
   const oauth2client = new googleapis.auth.OAuth2(
     CLIENT_ID,
     CLIENT_SECRET,
     REDIRECT_URI
   );
   oauth2client.credentials = {refresh_token: 'refresh_token'};
   assert.doesNotThrow(() => {
     const options = {auth: oauth2client, shortUrl: '...'};
     localUrlshortener.url.get(options, Utils.noop);
     remoteUrlshortener.url.get(options, Utils.noop);
   });
 });
開發者ID:google,項目名稱:google-api-nodejs-client,代碼行數:13,代碼來源:test.auth.ts

示例8: it

	it("should assert if node detached", ()=>
	{
		const list = new LinkedList<number>();
		list.add(1).add(2);
		assert.equal(list.count, 2);

		assert.equal(list.findLast(1)!.value,1);
		assert.equal(list.firstValue,1);
		assert.equal(list.find(2)!.value,2);
		assert.equal(list.lastValue,2);
		list.last!.value = 3;
		assert.equal(list.find(3)!.value,3);
		assert.equal(list.lastValue,3);

		list.addAfter(list.first!,5)
			.addFirst(0)
			.addLast(10);

		assert.equal(list.first!.value,0);
		assert.equal(list.getNodeAt(0)!.value,0);
		assert.equal(list.getValueAt(0),0);
		assert.equal(list!.getNodeAt(2)!.value,5);
		assert.equal(list.getValueAt(2),5);
		assert.equal(list!.getNodeAt(4)!.value,10);
		assert.equal(list.getValueAt(4),10);
		assert.ok(list.removeLast());
		assert.ok(list.removeFirst());
		const n = list.getNodeAt(1)!;
		assert.ok(list.removeAt(1));
		assert.throws(()=>n.value);

		const last = list.last!;
		assert.equal(last.previous!.value,1);
		assert.equal(last.previous!.next,last);
		last.remove();
		assert.ok(!last.list);
		assert.equal(list.count, 1);

		assert.doesNotThrow(()=>last.remove());
		assert.throws(()=>last.value);
		assert.throws(()=>last.next);
		assert.throws(()=>last.previous);

		const first = list.first!;
		list.dispose();
		assert.ok(!first.list);
		assert.throws(()=>first.value);

	})
開發者ID:electricessence,項目名稱:TypeScript.NET,代碼行數:49,代碼來源:LinkedList.ts


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