Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_printTypeahead(pattern: string, options: ScrollOptions) {
const matchedTests = this._getMatchedTests(pattern);
const total = matchedTests.length;
const pipe = this._pipe;
const prompt = this._prompt;
printPatternCaret(pattern, pipe);
pipe.write(ansiEscapes.cursorLeft);
if (pattern) {
printPatternMatches(
total,
'test',
pipe,
` from ${chalk.yellow('cached')} test suites`,
);
const width = getTerminalWidth(pipe);
const { start, end, index } = scroll(total, options);
prompt.setPromptLength(total);
_printTypeahead(pattern: string, options: ScrollOptions) {
const matchedTests = this._getMatchedTests(pattern);
const total = matchedTests.length;
const pipe = this._pipe;
const prompt = this._prompt;
printPatternCaret(pattern, pipe);
pipe.write(ansiEscapes.cursorLeft);
if (pattern) {
printPatternMatches(total, 'file', pipe);
const prefix = ` ${chalk.dim('\u203A')} `;
const padding = stringLength(prefix) + 2;
const width = getTerminalWidth(pipe);
const { start, end, index } = scroll(total, options);
prompt.setPromptLength(total);
matchedTests
.slice(start, end)
.map(({ path, context }) => {