Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
writePendingTests(evt) {
for (const [file, testsInFile] of evt.pendingTests) {
if (testsInFile.size === 0) {
continue;
}
this.lineWriter.writeLine(`${testsInFile.size} tests were pending in ${file}\n`);
for (const title of testsInFile) {
this.lineWriter.writeLine(`${figures.circleDotted} ${this.prefixTitle(file, title)}`);
}
this.lineWriter.writeLine('');
}
}
renderStatus(task: TaskInterface): string {
switch (task.status) {
case STATUS_PENDING:
return chalk.gray(figures.bullet);
case STATUS_RUNNING:
return chalk.gray(task.spinner());
case STATUS_SKIPPED:
return chalk.yellow(figures.circleDotted);
case STATUS_PASSED:
return chalk.green(figures.tick);
case STATUS_FAILED:
return chalk.red(figures.cross);
default:
return '';
}
}
module.exports = state => {
const items = [];
for (const [version, currentState] of state) {
let message;
let icon;
if (currentState === STATE_DOWNLOADING) {
message = chalk.grey('downloading base image');
icon = chalk.grey(figures.circleDotted);
}
if (currentState === STATE_BUILDING) {
message = chalk.grey('building environment');
icon = chalk.grey(figures.circleDotted);
}
if (currentState === STATE_CLEANING) {
message = chalk.grey('cleaning up');
icon = chalk.grey(figures.circleDotted);
}
if (currentState === STATE_RUNNING) {
message = chalk.grey('running');
icon = chalk.grey(figures.circleDotted);
}
writePendingTests(evt) {
for (const [file, testsInFile] of evt.pendingTests) {
if (testsInFile.size === 0) {
continue;
}
this.lineWriter.writeLine(`${testsInFile.size} tests were pending in ${file}\n`);
for (const title of testsInFile) {
this.lineWriter.writeLine(`${figures.circleDotted} ${this.prefixTitle(file, title)}`);
}
this.lineWriter.writeLine('');
}
}