本文整理汇总了TypeScript中@pushrocks/tapbundle.tap类的典型用法代码示例。如果您正苦于以下问题:TypeScript tap类的具体用法?TypeScript tap怎么用?TypeScript tap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了tap类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: async
import * as smartstring from '../ts/index';
import { tap, expect } from '@pushrocks/tapbundle';
// git
let testGit: smartstring.GitRepo;
tap.test('expect create a new Git class GitRepo', async () => {
testGit = new smartstring.GitRepo('git+https://github.com/pushrocks/smartstring.git');
expect(testGit).be.instanceof(smartstring.GitRepo);
});
tap.test('expect return a .host', async () => {
expect(testGit.host).equal('github.com');
});
tap.test('expect return a .user', async () => {
expect(testGit.user).equal('pushrocks');
});
tap.test('expect return a .repo', async () => {
expect(testGit.repo).equal('smartstring');
});
tap.test('expect return a .httpsUrl', async () => {
expect(testGit.httpsUrl).equal('https://github.com/pushrocks/smartstring.git');
});
tap.test('expect return a .sshUrl', async () => {
expect(testGit.sshUrl).equal('[email protected]:pushrocks/smartstring.git');
});
tap.start();
开发者ID:pushrocks,项目名称:smartstring,代码行数:26,代码来源:test.git.ts
示例2: async
import { expect, tap } from '@pushrocks/tapbundle';
import * as serverconfig from '../ts/index';
tap.test('first test', async () => {
serverconfig;
});
tap.start();
开发者ID:pushrocks,项目名称:serverconfig,代码行数:8,代码来源:test.ts
示例3: async
import * as smartstring from '../ts/index';
import { tap, expect } from '@pushrocks/tapbundle';
// Domain
let testDomain: smartstring.Domain;
let testDomain2: smartstring.Domain;
tap.test('expect create a new Domain object', async () => {
testDomain = new smartstring.Domain('https://level3D.level2D.level1D');
expect(testDomain).be.instanceof(smartstring.Domain);
console.log(testDomain);
});
tap.test('expect have a .topLevel', async () => {
expect(testDomain.topLevel).equal('level1D');
});
tap.test('expect have a .level2', async () => {
expect(testDomain.level2).equal('level2D');
});
tap.test('expect have a .level3', async () => {
expect(testDomain.level3).equal('level3D');
});
tap.test('expect have the correct dns zone name', async () => {
expect(testDomain.zoneName).equal('level2D.level1D');
});
tap.test('expect have the correct protocol', async () => {
expect(testDomain.protocol).equal('https');
});
tap.test('testDomain2 expect be a basic domain', async () => {
testDomain2 = new smartstring.Domain('bleu.de');
console.log(testDomain2);
});
开发者ID:pushrocks,项目名称:smartstring,代码行数:30,代码来源:test.domain.ts
示例4: async
import * as smartstring from '../ts/index';
import { tap, expect } from '@pushrocks/tapbundle';
// Base64
let testBase64: smartstring.Base64;
tap.test('expect create a valid instance of Base64', async () => {
testBase64 = new smartstring.Base64('somestring', 'string');
expect(testBase64).be.instanceOf(smartstring.Base64);
});
tap.test('expect read output a file as base64 and base64uri', async () => {
expect(testBase64.base64String).not.equal(testBase64.base64UriString);
let testBase64_2 = new smartstring.Base64(testBase64.base64UriString, 'base64uri');
expect(testBase64_2.simpleString).equal(testBase64.simpleString);
});
tap.start();
开发者ID:pushrocks,项目名称:smartstring,代码行数:16,代码来源:test.base64.ts
示例5: require
import { tap, expect } from '@pushrocks/tapbundle';
import projectinfo = require('../ts/index');
let path = require('path');
let testBasePath = path.resolve(__dirname);
let myNpm = new projectinfo.ProjectinfoNpm(testBasePath, { gitAccessToken: 'sometoken' });
tap.test('should have .packageJson', async () => {
expect(myNpm.packageJson).have.property('version', '1.0.0');
expect(myNpm.packageJson).have.property('name', 'testpackage');
});
tap.test('should have .version', async () => {
expect(myNpm).have.property('version', '1.0.0');
});
tap.test('should have .name', async () => {
expect(myNpm).have.property('name', 'testpackage');
});
tap.test('should have .license', async () => {
expect(myNpm).have.property('license', 'MIT');
});
tap.test('should have .git', async () => {
expect(myNpm.git.httpsUrl).equal('https://[email protected]/someuser/somerepo.git');
});
tap.test('should return a name', async () => {
expect(projectinfo.getNpmNameForDir(testBasePath)).equal('testpackage');
});
tap.start();
开发者ID:pushrocks,项目名称:projectinfo,代码行数:31,代码来源:test.ts
示例6: async
import * as smartstring from '../ts/index';
import { tap, expect } from '@pushrocks/tapbundle';
// indent
let testString = `
base
expect be indented
some more
base
indented
`;
// normalize
tap.test('expect normalize a string', async () => {
testString = smartstring.indent.normalize(testString);
console.log(testString);
let zoneNameArg = 'test1';
let destinationIpArg = '111';
});
// indent with prefix
tap.test('expect indent', async () => {
testString = smartstring.indent.indentWithPrefix(testString, '>> ');
console.log(testString);
});
tap.start();
开发者ID:pushrocks,项目名称:smartstring,代码行数:28,代码来源:test.indent.ts
示例7: require
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartdelay from '@pushrocks/smartdelay';
import early = require('../ts/index');
tap.test('.start()', async () => {
early.start('early');
await smartdelay.delayFor(2000);
});
tap.test('.stop()', async () => {
await early.stop();
});
tap.test('hrTime Measurement', async () => {
let earlyHr = new early.HrtMeasurement();
earlyHr.start();
await smartdelay.delayFor(1000);
let measuredTime = earlyHr.stop();
console.log(measuredTime);
return expect(measuredTime.milliSeconds).to.be.greaterThan(999);
});
tap.start();
开发者ID:pushrocks,项目名称:early,代码行数:23,代码来源:test.ts
示例8: require
import { expect, tap } from '@pushrocks/tapbundle';
import smartssh = require('../ts/index');
import path = require('path');
let testSshInstance: smartssh.SshInstance;
let testSshKey: smartssh.SshKey;
tap.test('should create a valid SshKey object', async () => {
testSshKey = new smartssh.SshKey({
host: 'example.com',
private: 'someExamplePrivateKey',
public: 'someExamplePublicKey'
});
expect(testSshKey).to.be.instanceof(smartssh.SshKey);
});
tap.test('.type should be a valid type', async () => {
expect(testSshKey.type).equal('duplex');
});
tap.test('.publicKey should be public key', async () => {
expect(testSshKey.pubKey).equal('someExamplePublicKey');
});
tap.test('.privateKey should be private key', async () => {
expect(testSshKey.privKey).equal('someExamplePrivateKey');
});
tap.test('.publicKeyBase64 should be public key base 64 encoded', async () => {
// tslint:disable-next-line:no-unused-expression
testSshKey.pubKeyBase64;
});
tap.test('.store() should store the file to disk', async () => {
testSshKey.store(path.join(process.cwd(), 'test/temp'));
});
开发者ID:pushrocks,项目名称:smartssh,代码行数:30,代码来源:test.ts
示例9: async
import * as smartstring from '../ts/index';
import { tap, expect } from '@pushrocks/tapbundle';
// Docker
tap.test('expect create a Env Object', async () => {
let envStringArray = ['VIRTUAL_HOST=sub.domain.tld', 'DEFAULT_HOST=some.domain.com'];
let envObject: any = smartstring.docker.makeEnvObject(envStringArray);
expect(envObject.VIRTUAL_HOST).to.equal('sub.domain.tld');
expect(envObject.DEFAULT_HOST).to.equal('some.domain.com');
});
tap.start();
开发者ID:pushrocks,项目名称:smartstring,代码行数:12,代码来源:test.docker.ts
示例10: async
import { tap, expect } from '@pushrocks/tapbundle';
import * as smartstring from '../ts/index';
tap.test('should normalize a string', async () => {
const testString = `
myawesome string;
is indented with two spaces
`;
const normalizedString = smartstring.normalize.standard(testString);
expect(normalizedString).to.equal(
`
myawesome string;
is indented with two spaces
`
);
});
tap.start();
开发者ID:pushrocks,项目名称:smartstring,代码行数:19,代码来源:test.normalize.ts
注:本文中的@pushrocks/tapbundle.tap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论