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


TypeScript assert.notStrictEqual函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。