jest-each
Advanced tools
Comparing version 30.0.0-alpha.4 to 30.0.0-alpha.5
@@ -117,2 +117,3 @@ /*! | ||
const INDEX_PLACEHOLDER = '%#'; | ||
const NUMBER_PLACEHOLDER = '%$'; | ||
const PLACEHOLDER_PREFIX = '%'; | ||
@@ -143,7 +144,7 @@ const ESCAPED_PLACEHOLDER_PREFIX = /%%/g; | ||
return util().format(formattedTitle, normalisedValue); | ||
}, interpolateTitleIndex(interpolateEscapedPlaceholders(title), rowIndex)).replaceAll(new RegExp(JEST_EACH_PLACEHOLDER_ESCAPE, 'g'), PLACEHOLDER_PREFIX); | ||
}, interpolateTitleIndexAndNumber(interpolateEscapedPlaceholders(title), rowIndex)).replaceAll(new RegExp(JEST_EACH_PLACEHOLDER_ESCAPE, 'g'), PLACEHOLDER_PREFIX); | ||
const normalisePlaceholderValue = value => typeof value === 'string' ? value.replaceAll(new RegExp(PLACEHOLDER_PREFIX, 'g'), JEST_EACH_PLACEHOLDER_ESCAPE) : value; | ||
const getMatchingPlaceholders = title => title.match(SUPPORTED_PLACEHOLDERS) || []; | ||
const interpolateEscapedPlaceholders = title => title.replaceAll(ESCAPED_PLACEHOLDER_PREFIX, JEST_EACH_PLACEHOLDER_ESCAPE); | ||
const interpolateTitleIndex = (title, index) => title.replace(INDEX_PLACEHOLDER, index.toString()); | ||
const interpolateTitleIndexAndNumber = (title, index) => title.replace(INDEX_PLACEHOLDER, index.toString()).replace(NUMBER_PLACEHOLDER, (index + 1).toString()); | ||
const interpolatePrettyPlaceholder = (title, value) => title.replace(PRETTY_PLACEHOLDER, (0, _prettyFormat().format)(value, { | ||
@@ -150,0 +151,0 @@ maxDepth: 1, |
{ | ||
"name": "jest-each", | ||
"version": "30.0.0-alpha.4", | ||
"version": "30.0.0-alpha.5", | ||
"description": "Parameterised tests for Jest", | ||
@@ -30,7 +30,7 @@ "main": "./build/index.js", | ||
"dependencies": { | ||
"@jest/types": "30.0.0-alpha.4", | ||
"@jest/types": "30.0.0-alpha.5", | ||
"chalk": "^4.0.0", | ||
"jest-get-type": "30.0.0-alpha.4", | ||
"jest-util": "30.0.0-alpha.4", | ||
"pretty-format": "30.0.0-alpha.4" | ||
"jest-get-type": "30.0.0-alpha.5", | ||
"jest-util": "30.0.0-alpha.5", | ||
"pretty-format": "30.0.0-alpha.5" | ||
}, | ||
@@ -43,3 +43,3 @@ "engines": { | ||
}, | ||
"gitHead": "32b966f988d47a7673d2ef4b92e834dab7d66f07" | ||
"gitHead": "fa24a3bdd6682978d76799265016fb9d5bff135e" | ||
} |
@@ -43,2 +43,3 @@ <div align="center"> | ||
- `%#` - Index of the test case. | ||
- `%$` - Number of the test case. | ||
- `%%` - single percent sign ('%'). This does not consume an argument. | ||
@@ -122,2 +123,3 @@ - Unique test titles by injecting properties of test case object | ||
- `%#` - Index of the test case. | ||
- `%$` - Number of the test case. | ||
- `%%` - single percent sign ('%'). This does not consume an argument. | ||
@@ -149,2 +151,3 @@ - Or generate unique test titles by injecting properties of test case object with `$variable` | ||
- `%#` - Index of the test case. | ||
- `%$` - Number of the test case. | ||
- `%%` - single percent sign ('%'). This does not consume an argument. | ||
@@ -151,0 +154,0 @@ - Or generate unique test titles by injecting properties of test case object with `$variable` |
35298
521
552
+ Added@jest/pattern@30.0.0-alpha.5(transitive)
+ Added@jest/schemas@30.0.0-alpha.5(transitive)
+ Added@jest/types@30.0.0-alpha.5(transitive)
+ Addedjest-get-type@30.0.0-alpha.5(transitive)
+ Addedjest-regex-util@30.0.0-alpha.5(transitive)
+ Addedjest-util@30.0.0-alpha.5(transitive)
+ Addedpretty-format@30.0.0-alpha.5(transitive)
- Removed@jest/schemas@30.0.0-alpha.4(transitive)
- Removed@jest/types@30.0.0-alpha.4(transitive)
- Removedjest-get-type@30.0.0-alpha.4(transitive)
- Removedjest-regex-util@30.0.0-alpha.4(transitive)
- Removedjest-util@30.0.0-alpha.4(transitive)
- Removedpretty-format@30.0.0-alpha.4(transitive)
Updated@jest/types@30.0.0-alpha.5
Updatedjest-get-type@30.0.0-alpha.5
Updatedjest-util@30.0.0-alpha.5
Updatedpretty-format@30.0.0-alpha.5