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


TypeScript tapbundle.tap類代碼示例

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


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

示例1: async

import { tap, expect } from 'tapbundle'
import * as smartenv from '../ts/index'

let testEnv: smartenv.Smartenv

tap.test('should print env', async () => {
  testEnv = new smartenv.Smartenv()
})

tap.test('should print a overview to console', async () => {
  testEnv.printEnv()
})

tap.test('should get os', async () => {
  let resultMac = await testEnv.isMacAsync()
  let resultLinux = await testEnv.isLinuxAsync()
  let resultWindows = await testEnv.isWindowsAsync()
  const osModule = await import('os')
  if (resultMac) {
    expect(osModule.platform()).to.equal('darwin');
    console.log('platform is Mac!')
  } else if (resultLinux) {
    expect(osModule.platform()).to.equal('linux');
    console.log('platform is Linux!')
  } else {
    expect(osModule.platform()).to.equal('win32');
    console.log('platform is Windows!')
  }
  
})
開發者ID:pushrocks,項目名稱:smartenv,代碼行數:30,代碼來源:test.ts

示例2: require

import { tap, expect } from 'tapbundle'

import coreflow = require('../dist/index')

tap.test('should startup correctly', async () => {
  coreflow.start()
})

tap.start()
開發者ID:pushrocks,項目名稱:coreflow,代碼行數:9,代碼來源:test.ts

示例3: async

import { expect, tap } from 'tapbundle';
import * as shipzone from '../ts/index';

let testShipzone: shipzone.ShipZone;

tap.test('should create a valid instance of shipzone', async () => {
  console.log('hey');
  testShipzone = new shipzone.ShipZone();
  expect(testShipzone).to.be.instanceof(shipzone.ShipZone);
});

tap.test('should connect to servezone', async () => {
  testShipzone.szConnection;
});

tap.start();
開發者ID:shipzone,項目名稱:shipzone,代碼行數:16,代碼來源:test.ts

示例4: async

import { expect, tap } from 'tapbundle';

import * as npmgInstall from '../ts/tools.install';
import * as smartenv from 'smartenv';

let environment = new smartenv.Smartenv();

tap.test("should install default list globally when parsed 'default' as argument", async () => {
  await npmgInstall.install('default');
});

tap.start();
開發者ID:GitZoneTools,項目名稱:npmg,代碼行數:12,代碼來源:test.ts

示例5: async

import { tap, expect } from 'tapbundle'
import * as billtoday from '../ts/index'


tap.test('should create a valid Invoice', async () => {
})

tap.start()
開發者ID:billtoday,項目名稱:bts,代碼行數:8,代碼來源:test.ts

示例6: async

import * as smarterror from '../ts/index';

import { expect, tap } from 'tapbundle';

let originalError: smarterror.SmartError;
tap.test('should create a valid error', async () => {
  originalError = new smarterror.SmartError('wow');
  expect(originalError).to.be.instanceof(Error);
  console.log(originalError.cleanFullStack);
});

tap.test('should accept another error as cause', async () => {
  let anotherError = new smarterror.SmartError('this is another Error', originalError);
  console.log(anotherError.cleanFullStack);
})

tap.start();
開發者ID:pushrocks,項目名稱:smarterror,代碼行數:17,代碼來源:test.ts


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