当前位置: 首页>>代码示例>>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;未经允许,请勿转载。