当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript colors.blue函数代码示例

本文整理汇总了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;
          });
      });
	});
});
开发者ID:cebor,项目名称:rollup-plugin-angular,代码行数:33,代码来源:component.spec.ts

示例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)
       }
     }
   }
 }
开发者ID:tulayang,项目名称:moca,代码行数:13,代码来源:moca.ts

示例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`)
         }
     };
 },
开发者ID:khell,项目名称:scrape-coinjar,代码行数:15,代码来源:index.ts

示例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');
    }
}
开发者ID:herculesinc,项目名称:credo.logger,代码行数:17,代码来源:ConsoleLogger.ts

示例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)
     }
   }
 }
开发者ID:tulayang,项目名称:moca,代码行数:21,代码来源:moca.ts


注:本文中的colors.blue函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。