本文整理匯總了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!')
}
})
示例2: require
import { tap, expect } from 'tapbundle'
import coreflow = require('../dist/index')
tap.test('should startup correctly', async () => {
coreflow.start()
})
tap.start()
示例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();
示例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();
示例5: async
import { tap, expect } from 'tapbundle'
import * as billtoday from '../ts/index'
tap.test('should create a valid Invoice', async () => {
})
tap.start()
示例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();