@vitest/runner 2.0.0-beta.6 → 2.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +13 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import limit from 'p-limit';
2
- import { getSafeTimers, isObject, createDefer, format, objDisplay, objectAttr, toArray, shuffle } from '@vitest/utils';
2
+ import { getSafeTimers, isObject, createDefer, isNegativeNaN, format, objDisplay, objectAttr, toArray, shuffle } from '@vitest/utils';
3
3
  import { processError } from '@vitest/utils/error';
4
4
  export { processError } from '@vitest/utils/error';
5
5
  import { k as createChainable, a as createFileTask, c as calculateSuiteHash, s as someTasksAreOnly, i as interpretTaskModes, p as partitionSuiteChildren, h as hasTests, f as hasFailed } from './chunk-tasks.js';
@@ -557,6 +557,18 @@ function formatTitle(template, items, idx) {
557
557
  template = template.replace(/%%/g, "__vitest_escaped_%__").replace(/%#/g, `${idx}`).replace(/__vitest_escaped_%__/g, "%%");
558
558
  }
559
559
  const count = template.split("%").length - 1;
560
+ if (template.includes("%f")) {
561
+ const placeholders = template.match(/%f/g) || [];
562
+ placeholders.forEach((_, i) => {
563
+ if (isNegativeNaN(items[i]) || Object.is(items[i], -0)) {
564
+ let occurrence = 0;
565
+ template = template.replace(/%f/g, (match) => {
566
+ occurrence++;
567
+ return occurrence === i + 1 ? "-%f" : match;
568
+ });
569
+ }
570
+ });
571
+ }
560
572
  let formatted = format(template, ...items.slice(0, count));
561
573
  if (isObject(items[0])) {
562
574
  formatted = formatted.replace(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/runner",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.6",
4
+ "version": "2.0.0-beta.7",
5
5
  "description": "Vitest test runner",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "p-limit": "^5.0.0",
42
42
  "pathe": "^1.1.2",
43
- "@vitest/utils": "2.0.0-beta.6"
43
+ "@vitest/utils": "2.0.0-beta.7"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "rimraf dist && rollup -c",