本文整理汇总了TypeScript中colors.blue函数的典型用法代码示例。如果您正苦于以下问题:TypeScript blue函数的具体用法?TypeScript blue怎么用?TypeScript blue使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了blue函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe('rollup-plugin-angular', () => {
console.info(`-------------------`);
console.info(colors.blue(`start test mocha:ts`));
console.info(`-------------------`);
beforeEach(() => {
});
it('should not have example-component.html file content loaded from comment', () => {
return bundle()
.then(bundle => {
return bundle
.generate({ format: 'iife', moduleName: 'component' })
.then(generated => {
assert.ok(generated.code);
expect(generated.code.includes(`example-component.html content loaded`)).to.equal(false);
return generated;
});
});
});
it('should have component.html file content loaded', () => {
return bundle()
.then(bundle => {
return bundle
.generate({ format: 'iife', moduleName: 'component' })
.then(generated => {
assert.ok(generated.code);
expect(generated.code.includes(`component.html content loaded`)).to.equal(true);
return generated;
});
});
});
});
示例2: echoError
public echoError() {
for (var t of this.tests) {
if (t.error && t.error.stack) {
var lines: Array<string> = t.error.stack.split('\n')
console.log(colors.bold(colors.blue('\n' + this.description + ' * ')) +
colors.bold(colors.red(t.description + ' \'' + lines[0])))
lines.shift()
for (var line of lines) {
console.log(line)
}
}
}
}
示例3: async
Coinbase: async () => {
const usd = await rp({ uri: 'https://api.coinbase.com/v2/prices/spot?currency=USD', json: true });
const aud = await rp({ uri: 'https://api.coinbase.com/v2/prices/spot?currency=AUD', json: true });
return {
usd: {
raw: parseFloat(usd.data.amount),
formatted: colors.green(`$${parseFloat(usd.data.amount).toFixed(2)}USD`)
},
aud: {
raw: parseFloat(aud.data.amount),
formatted: colors.blue(`$${parseFloat(aud.data.amount).toFixed(2)}AUD`)
}
};
},
示例4: applyColor
function applyColor(message: string, color: Color): string {
if (!message) return;
if (!color) return message;
switch (color) {
case Color.black: return colors.black(message);
case Color.red: return colors.red(message);
case Color.green: return colors.green(message);
case Color.yellow: return colors.yellow(message);
case Color.blue: return colors.blue(message);
case Color.magenta: return colors.magenta(message);
case Color.cyan: return colors.cyan(message);
case Color.white: return colors.white(message);
case Color.grey: return colors.grey(message);
default: throw new Error('Invalid Color');
}
}
示例5: run
public async run() {
console.log(colors.bold(colors.blue('\n[Suite]')), this.description)
for (var t of this.tests) {
if (this.setupPromise) {
await this.setupPromise()
}
try {
await t.promise()
if (this.teardownPromise) {
await this.teardownPromise()
}
console.log(colors.bold(colors.green(' [OK]')), t.description)
} catch (e) {
t.error = e
if (this.teardownPromise) {
await this.teardownPromise()
}
console.log(colors.bold(colors.red(' [FAILED 0]')), t.description)
}
}
}