Socket
Socket
Sign inDemoInstall

jest-watch-typeahead

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-watch-typeahead - npm Package Compare versions

Comparing version 0.2.2-0 to 0.2.2-1

19

build/lib/utils.js

@@ -128,20 +128,21 @@ "use strict";

const endPatternIndex = startPatternIndex + match[0].length;
const testNameFitsInTerminal = inlineTestName.length <= width;
if (inlineTestName.length <= width) {
if (testNameFitsInTerminal) {
return colorize(inlineTestName, startPatternIndex, endPatternIndex);
}
const slicedTestName = inlineTestName.slice(0, width - DOTS.length);
const numberOfTruncatedChars = DOTS.length + inlineTestName.length - width;
const end = Math.max(endPatternIndex - numberOfTruncatedChars, 0);
const truncatedTestName = inlineTestName.slice(numberOfTruncatedChars);
const shouldHighlightDots = startPatternIndex <= numberOfTruncatedChars;
if (startPatternIndex < slicedTestName.length) {
if (endPatternIndex > slicedTestName.length) {
return colorize(slicedTestName + DOTS, startPatternIndex, slicedTestName.length + DOTS.length);
}
return colorize(slicedTestName + DOTS, Math.min(startPatternIndex, slicedTestName.length), endPatternIndex);
if (shouldHighlightDots) {
return colorize(DOTS + truncatedTestName, 0, end + DOTS.length);
}
return `${_chalk.default.dim(slicedTestName)}${_chalk.default.reset(DOTS)}`;
const start = startPatternIndex - numberOfTruncatedChars;
return colorize(DOTS + truncatedTestName, start + DOTS.length, end + DOTS.length);
};
exports.formatTestNameByPattern = formatTestNameByPattern;

@@ -6,2 +6,3 @@ ## master

- Bump dated dependencies ([#25](https://github.com/jest-community/jest-watch-typeahead/pull/25))
- Get better truncation for testname typeahead by truncating the start and not the end ([#28](https://github.com/jest-community/jest-watch-typeahead/pull/28))

@@ -8,0 +9,0 @@ ### Fixes

{
"name": "jest-watch-typeahead",
"version": "0.2.2-0",
"version": "0.2.2-1",
"main": "build/index.js",

@@ -5,0 +5,0 @@ "author": "Rogelio Guzman <rogelioguzmanh@gmail.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc