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


TypeScript bold.red方法代码示例

本文整理汇总了TypeScript中chalk.bold.red方法的典型用法代码示例。如果您正苦于以下问题:TypeScript bold.red方法的具体用法?TypeScript bold.red怎么用?TypeScript bold.red使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chalk.bold的用法示例。


在下文中一共展示了bold.red方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: enhanceUnexpectedTokenMessage

export default function enhanceUnexpectedTokenMessage(e: Error) {
  e.stack =
    `${chalk.bold.red('Jest encountered an unexpected token')}

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
${DOT}To have some of your "node_modules" files transformed, you can specify a custom ${chalk.bold(
      '"transformIgnorePatterns"',
    )} in your config.
${DOT}If you need a custom transformation specify a ${chalk.bold(
      '"transform"',
    )} option in your config.
${DOT}If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the ${chalk.bold(
      '"moduleNameMapper"',
    )} config option.

You'll find more details and examples of these config options in the docs:
${chalk.cyan('https://jestjs.io/docs/en/configuration.html')}

${chalk.bold.red('Details:')}

` + e.stack;

  return e;
}
开发者ID:Volune,项目名称:jest,代码行数:28,代码来源:enhanceUnexpectedTokenMessage.ts

示例2: switch

 diffResult.diffSet.forEach(function(entry) {
   switch (entry.state) {
     case 'equal':
       return;
     case 'left':
       const expectedFileRelPath =
           path.join(entry.relativePath || '/', entry.name1);
       errorOutputLines.push((chalk.bold.green(' + ' + expectedFileRelPath)));
       return;
     case 'right':
       const actualFileRelPath =
           path.join(entry.relativePath || '/', entry.name2);
       errorOutputLines.push((chalk.bold.red(' - ' + actualFileRelPath)));
       return;
     case 'distinct':
       const diffedFileRelPath =
           path.join(entry.relativePath || '/', entry.name1);
       const expectedFilePath = path.join(entry.path1, entry.name1);
       const actualFilePath = path.join(entry.path2, entry.name2);
       const patch = diff.createPatch(
           'string',
           fs.readFileSync(expectedFilePath, 'utf8'),
           fs.readFileSync(actualFilePath, 'utf8'),
           'expected',
           'converted');
       errorOutputLines.push((chalk.bold.red('<> ' + diffedFileRelPath)));
       errorOutputLines.push(formatDiffPatch(patch));
       return;
     default:
       throw new Error('Unexpected diff-entry format: ' + entry);
   }
 });
开发者ID:,项目名称:,代码行数:32,代码来源:

示例3: debug

    tailer.on('exit', (result, details) => {
      debug('Install: Build tools tailer exited');

      if (result === 'error') {
        debug('Installer: Tailer found error with installer', details);
        reject(new Error(`Found error with VCC installer: ${details}`));
      }

      if (result === 'success') {
        vccLastLines = [ chalk.bold.green('Successfully installed Visual Studio Build Tools.') ];
        debug('Installer: Successfully installed Visual Studio Build Tools according to tailer');
        resolve({ success: true, toConfigure: true });
      }

      // Stop the log now. If we need to report failures, we need
      // to do it after the single-line-logger has stopped messing
      // with the terminal.
      logStatus();
      stopLog();

      if (result === 'failure') {
        log(chalk.bold.red('\nCould not install Visual Studio Build Tools.'));
        log('Please find more details in the log files, which can be found at');
        log(getWorkDirectory() + '\n');
        debug('Installer: Failed to install according to tailer');
        resolve({ success: false });
      }
    });
开发者ID:felixrieseberg,项目名称:windows-build-tools,代码行数:28,代码来源:index.ts

示例4: getValues

export const errorMessage = (
  option: string,
  received: any,
  defaultValue: any,
  options: ValidationOptions,
  path?: Array<string>,
): void => {
  const conditions = getValues(defaultValue);
  const validTypes: Array<string> = Array.from(
    new Set(conditions.map(getType)),
  );

  const message = `  Option ${chalk.bold(
    `"${path && path.length > 0 ? path.join('.') + '.' : ''}${option}"`,
  )} must be of type:
    ${validTypes.map(e => chalk.bold.green(e)).join(' or ')}
  but instead received:
    ${chalk.bold.red(getType(received))}

  Example:
${formatExamples(option, conditions)}`;

  const comment = options.comment;
  const name = (options.title && options.title.error) || ERROR;

  throw new ValidationError(name, message, comment);
};
开发者ID:Volune,项目名称:jest,代码行数:27,代码来源:errors.ts

示例5: switch

 mutants.forEach(mutant => {
   switch (mutant.status) {
     case MutantStatus.KILLED:
       mutantsKilled++;
       break;
     case MutantStatus.TIMEDOUT:
       mutantsTimedOut++;
       break;
     case MutantStatus.SURVIVED:
       console.log(chalk.bold.red('Mutant survived!'));
       console.log(mutant.filename + ': line ' + mutant.lineNumber + ':' + mutant.columnNumber);
       console.log('Mutation: ' + mutant.mutation.name);
       console.log(chalk.red('-   ' + mutant.originalLine));
       console.log(chalk.green('+   ' + mutant.mutatedLine));
       console.log('\n');
       console.log('Tests ran: ');
       _.forEach(mutant.specsRan, function(spec: string) {
         console.log('    ' + spec);
       });
       console.log('\n');
       break;
     case MutantStatus.UNTESTED:
       mutantsUntested++;
       break;
   }
 });
开发者ID:Dragnipur,项目名称:stryker,代码行数:26,代码来源:ConsoleReporter.ts

示例6:

			(key, options) => {
				if (argv[key] === undefined && isRequiredOption(options)) {
					if (!validationError) {
						validationError = `\n${chalk.bold.red('Error(s):')}`;
					}
					validationError = `${validationError}\n  Required option '${chalk.redBright(key)}' not provided`;
				}
			},
开发者ID:dojo,项目名称:cli,代码行数:8,代码来源:validation.ts

示例7: printError

    public printError(error: string) {
        let message = `abort: ${error}${EOL}`;
        if (this._colorStderr) {
            message = chalk.bold.red(message);
        }

        this.stderr.write(message, "utf8");
    }
开发者ID:rbuckton,项目名称:power-options,代码行数:8,代码来源:commandLine.ts

示例8: output

function output(msg: string, severity: string) {
    if (severity === "warning") {
        console.warn(chalk.bold.yellow(msg));
    } else if (severity === "error") {
        console.error(chalk.bold.red(msg));
    } else {
        console.log(msg);
    }
}
开发者ID:rfrerebe,项目名称:Fable,代码行数:9,代码来源:index.ts

示例9: error

export function error(...args: any[]) {
  if (args.length > 1) {
    args[0] = chalk.bold.red(args[0]);
  }

  if (!process.env.MUTE_CLI_LOG) {
    console.error.apply(console, args);
  }
}
开发者ID:janpersiel,项目名称:stylegen,代码行数:9,代码来源:Logger.ts


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