• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript assert.notStrictEqual函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中assert.notStrictEqual函数的典型用法代码示例。如果您正苦于以下问题:TypeScript notStrictEqual函数的具体用法?TypeScript notStrictEqual怎么用?TypeScript notStrictEqual使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了notStrictEqual函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: 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:ntilwalli,项目名称:cyclejs,代码行数:12,代码来源:events.ts


示例2: testInsert

async function testInsert(urlshortener: urlshortener_v1.Urlshortener) {
  const requestBody = {longUrl: 'http://google.com/'};
  nock(Utils.baseUrl)
    .post('/resource')
    .reply(200);
  const res = await urlshortener.url.insert({requestBody});
  assert.notStrictEqual(res.data, null);
  assert.notStrictEqual(res.data.kind, null);
  assert.notStrictEqual(res.data.id, null);
  assert.strictEqual(res.data.longUrl, 'http://google.com/');
  return res;
}
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:12,代码来源:test.urlshortener.v1.ts


示例3: setTimeout

 next: (elements: Array<Element>) => {
   assert.strictEqual(Array.isArray(elements), true);
   assert.strictEqual(elements.length, 1);
   const correctElement = elements[0];
   assert.notStrictEqual(correctElement, null);
   assert.notStrictEqual(typeof correctElement, 'undefined');
   assert.strictEqual(correctElement.tagName, 'SPAN');
   setTimeout(() => {
     dispose();
     done();
   });
 },
开发者ID:joeldentici,项目名称:cyclejs,代码行数:12,代码来源:isolation.ts


示例4: setTimeout

 next: (elements: Array<Element>) => {
   assert.strictEqual(elements.length, 1);
   const element = elements[0];
   assert.notStrictEqual(element, null);
   assert.notStrictEqual(typeof element, 'undefined');
   assert.strictEqual(element.tagName, 'H4');
   assert.strictEqual(element.textContent, 'Correct');
   setTimeout(() => {
     dispose();
     done();
   });
 },
开发者ID:cyclejs,项目名称:cyclejs,代码行数:12,代码来源:select.ts


示例5: FileWalker

		walker.readStdout(cmd1, 'utf8', /*isRipgrep=*/false, (err1, stdout1) => {
			assert.equal(err1, null);
			assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1);
			assert.notStrictEqual(stdout1.split('\n').indexOf(file1), -1, stdout1);

			const walker = new FileWalker({ folderQueries: ROOT_FOLDER_QUERY, excludePattern: { 'examples/subfolder': true } });
			const cmd2 = walker.spawnFindCmd(TEST_ROOT_FOLDER);
			walker.readStdout(cmd2, 'utf8', /*isRipgrep=*/false, (err2, stdout2) => {
				assert.equal(err2, null);
				assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1);
				assert.strictEqual(stdout2.split('\n').indexOf(file1), -1, stdout2);
				done();
			});
		});
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:14,代码来源:search.test.ts


示例6: FileWalker

		walker.readStdout(cmd1, 'utf8', (err1, stdout1) => {
			assert.equal(err1, null);
			assert.notStrictEqual(stdout1!.split('\n').indexOf(file0), -1, stdout1);
			assert.notStrictEqual(stdout1!.split('\n').indexOf(file1), -1, stdout1);

			const walker = new FileWalker({ type: QueryType.File, folderQueries: ROOT_FOLDER_QUERY, excludePattern: { '**/subfolder/anotherfolder': true } });
			const cmd2 = walker.spawnFindCmd(TEST_ROOT_FOLDER);
			walker.readStdout(cmd2, 'utf8', (err2, stdout2) => {
				assert.equal(err2, null);
				assert.notStrictEqual(stdout1!.split('\n').indexOf(file0), -1, stdout1);
				assert.strictEqual(stdout2!.split('\n').indexOf(file1), -1, stdout2);
				done();
			});
		});
开发者ID:PKRoma,项目名称:vscode,代码行数:14,代码来源:search.test.ts


示例7: setTimeout

 next: (root: Element) => {
   const wrongElement = root.querySelector('.bar') as HTMLElement;
   const correctElement = root.querySelector('.foo .bar') as HTMLElement;
   assert.notStrictEqual(wrongElement, null);
   assert.notStrictEqual(correctElement, null);
   assert.notStrictEqual(typeof wrongElement, 'undefined');
   assert.notStrictEqual(typeof correctElement, 'undefined');
   assert.strictEqual(wrongElement.tagName, 'H2');
   assert.strictEqual(correctElement.tagName, 'H4');
   assert.doesNotThrow(function() {
     setTimeout(() => wrongElement.click());
     setTimeout(() => correctElement.click(), 15);
   });
 },
开发者ID:joeldentici,项目名称:cyclejs,代码行数:14,代码来源:events.ts


示例8: it

  it('should include default params when only callback is provided to API call', async () => {
    const google = new GoogleApis();
    const datastore = google.datastore({
      version: 'v1',
      params: {
        // We must set this here - it is a required param
        projectId: 'test-project-id',
        myParam: '123',
      },
    });
    // No params given - only callback
    createNock('myParam=123');
    const res = await datastore.projects.lookup();
    // If the default param handling is broken, req or query might be
    // undefined, thus concealing the assertion message with some generic
    // "cannot call .indexOf of undefined"
    const query = Utils.getQs(res) || '';

    assert.notStrictEqual(
      query.indexOf('myParam=123'),
      -1,
      'Default param not found in query'
    );

    nock.enableNetConnect();
    const datastore2 = await Utils.loadApi(google, 'datastore', 'v1', {
      params: {
        projectId: 'test-project-id', // We must set this here - it is a
        // required param
        myParam: '123',
      },
    });

    nock.disableNetConnect();

    // No params given - only callback
    createNock('myParam=123');
    // tslint:disable-next-line no-any
    const res3 = await (datastore2 as any).projects.lookup();
    // If the default param handling is broken, req or query might be
    // undefined, thus concealing the assertion message with some
    // generic "cannot call .indexOf of undefined"
    const query2 = Utils.getQs(res3) || '';
    assert.notStrictEqual(
      query2.indexOf('myParam=123'),
      -1,
      'Default param not found in query'
    );
  });
开发者ID:google,项目名称:google-api-nodejs-client,代码行数:49,代码来源:test.clients.ts


示例9: setTimeout

 next: (root: Element) => {
   const frameFoo = root.querySelector('.foo.frame') as HTMLElement;
   const monalisaFoo = root.querySelector('.foo.monalisa') as HTMLElement;
   assert.notStrictEqual(frameFoo, null);
   assert.notStrictEqual(monalisaFoo, null);
   assert.notStrictEqual(typeof frameFoo, 'undefined');
   assert.notStrictEqual(typeof monalisaFoo, 'undefined');
   assert.strictEqual(frameFoo.tagName, 'H4');
   assert.strictEqual(monalisaFoo.tagName, 'SPAN');
   assert.doesNotThrow(() => {
     setTimeout(() => monalisaFoo.click());
     setTimeout(() => monalisaFoo.click());
     setTimeout(() => frameFoo.click(), 0);
   });
 },
开发者ID:whitecolor,项目名称:cyclejs,代码行数:15,代码来源:isolation.ts



注:本文中的assert.notStrictEqual函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript assert.ok函数代码示例发布时间:2022-05-25
下一篇:
TypeScript assert.notEqual函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap