@approval-tests/approvals 7.5.7 → 7.5.8

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.
@@ -7,11 +7,14 @@ exports.getVitestNamer = getVitestNamer;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const Namer_1 = require("../../Namer");
9
9
  const Namer_2 = require("../../Core/Namer");
10
+ const StringUtils_1 = require("../../Utilities/StringUtils");
10
11
  function getVitestNamer() {
12
+ var _a;
11
13
  const state = expect.getState();
12
14
  const file = path_1.default.parse(state.testPath);
13
15
  const testPath = file.dir;
14
16
  const testFileName = file.name;
15
- const testName = (0, Namer_2.convertToFilename)(`${testFileName}.${state.currentTestName}`);
17
+ const currentTestNameWithoutSeparators = StringUtils_1.StringUtils.replaceAll((_a = state.currentTestName) !== null && _a !== void 0 ? _a : "", " > ", " ");
18
+ const testName = (0, Namer_2.convertToFilename)(`${testFileName}.${currentTestNameWithoutSeparators}`);
16
19
  return new Namer_1.Namer(testPath, testName);
17
20
  }
@@ -1,6 +1,7 @@
1
1
  import path from "path";
2
2
  import { Namer } from "../../Namer";
3
3
  import { convertToFilename } from "../../Core/Namer";
4
+ import { StringUtils } from "../../Utilities/StringUtils";
4
5
 
5
6
  interface VitestExpectState {
6
7
  testPath?: string;
@@ -14,8 +15,13 @@ export function getVitestNamer(): Namer {
14
15
  const file = path.parse(state.testPath as string);
15
16
  const testPath = file.dir;
16
17
  const testFileName = file.name;
18
+ const currentTestNameWithoutSeparators = StringUtils.replaceAll(
19
+ state.currentTestName ?? "",
20
+ " > ",
21
+ " ",
22
+ );
17
23
  const testName = convertToFilename(
18
- `${testFileName}.${state.currentTestName}`,
24
+ `${testFileName}.${currentTestNameWithoutSeparators}`,
19
25
  );
20
26
  return new Namer(testPath, testName);
21
27
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "description": "Approval Tests Library - Capturing Human Intelligence",
7
- "version": "7.5.7",
7
+ "version": "7.5.8",
8
8
  "homepage": "http://approvaltests.com",
9
9
  "author": {
10
10
  "name": "Jason Jarrett",
@@ -93,7 +93,7 @@
93
93
  "sinon": "^22.0.0",
94
94
  "ts-node": "^10.9.1",
95
95
  "typescript": "^6.0.2",
96
- "vitest": "^4.1.8"
96
+ "vitest": "^5.0.1"
97
97
  },
98
98
  "keywords": [
99
99
  "Approve",