@approval-tests/approvals 7.5.13 → 7.6.0

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.
@@ -30,8 +30,8 @@ class LogUtils {
30
30
  }
31
31
  static downloadApproveAllScriptIfMissing() {
32
32
  return __awaiter(this, void 0, void 0, function* () {
33
- yield this.downloadFile(`approve_all.py`);
34
- yield this.downloadFile(`remove_abandoned_files.py`);
33
+ void this.downloadFile(`approve_all.py`);
34
+ void this.downloadFile(`remove_abandoned_files.py`);
35
35
  });
36
36
  }
37
37
  static downloadFile(script) {
@@ -40,7 +40,9 @@ class LogUtils {
40
40
  const scriptPath = path_1.default.join(this.APPROVAL_TEMP_DIRECTORY, script);
41
41
  if (!fs_1.default.existsSync(scriptPath)) {
42
42
  const githubUrl = "https://raw.githubusercontent.com/approvals/ApprovalTests.CommonScripts/refs/heads/main/";
43
- const response = yield axios_1.default.get(`${githubUrl}${script}`);
43
+ const response = yield axios_1.default.get(`${githubUrl}${script}`, {
44
+ timeout: 3000,
45
+ });
44
46
  fs_1.default.writeFileSync(scriptPath, response.data);
45
47
  fs_1.default.chmodSync(scriptPath, 0o755);
46
48
  }
@@ -0,0 +1,4 @@
1
+ import { GenericDiffReporterBase } from "../GenericDiffReporterBase";
2
+ export default class WebStormReporter extends GenericDiffReporterBase {
3
+ constructor(executablePath?: string);
4
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const AUtils_1 = require("../../AUtils");
4
+ const fs_1 = require("fs");
5
+ const os_1 = require("os");
6
+ const path_1 = require("path");
7
+ const osTools_1 = require("../../osTools");
8
+ const GenericDiffReporterBase_1 = require("../GenericDiffReporterBase");
9
+ class WebStormReporter extends GenericDiffReporterBase_1.GenericDiffReporterBase {
10
+ constructor(executablePath) {
11
+ super("webstorm");
12
+ this.setCommandArgs = (approved, received) => ["diff", received, approved];
13
+ if (executablePath !== undefined) {
14
+ this.exePath = executablePath;
15
+ return;
16
+ }
17
+ const launchers = osTools_1.platform.isWindows
18
+ ? ["webstorm64.exe", "webstorm.exe"]
19
+ : osTools_1.platform.isMac
20
+ ? ["webstorm"]
21
+ : ["webstorm", "webstorm.sh"];
22
+ for (const launcher of launchers) {
23
+ const executable = (0, AUtils_1.findProgramOnPath)(launcher);
24
+ if (executable) {
25
+ this.exePath = executable;
26
+ return;
27
+ }
28
+ }
29
+ if (osTools_1.platform.isMac) {
30
+ const applications = ["/Applications", (0, path_1.join)((0, os_1.homedir)(), "Applications")];
31
+ for (const directory of applications) {
32
+ const launcher = (0, path_1.join)(directory, "WebStorm.app", "Contents", "MacOS", "webstorm");
33
+ if ((0, fs_1.existsSync)(launcher)) {
34
+ this.exePath = launcher;
35
+ return;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ exports.default = WebStormReporter;
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.13",
7
+ "version": "7.6.0",
8
8
  "homepage": "http://approvaltests.com",
9
9
  "author": {
10
10
  "name": "Jason Jarrett",
@@ -59,7 +59,7 @@
59
59
  "callsite": "^1.0.0",
60
60
  "diff": "^9.0.0",
61
61
  "event-stream": "^4.0.1",
62
- "glob": "^13.0.0",
62
+ "glob": "^14.0.3",
63
63
  "js-yaml": "^5.1.0",
64
64
  "lodash": "^4.17.21",
65
65
  "magic-bytes.js": "^1.13.1",
package/readme.md CHANGED
@@ -213,6 +213,7 @@ Any of the following reporter may suite your needs. Some support images, some on
213
213
  | `visualstudio` | [Visual Studio Diff tool](http://msdn.microsoft.com/en-us/library/bb385990.aspx) | ✓ | |
214
214
  | `vscode` | [Visual Studio Code Diff tool](https://code.visualstudio.com/) | ✓ | ✓ |
215
215
  | `vscodium` | [VSCodium Diff tool](https://vscodium.com/) | ✓ | ✓ |
216
+ | `webstorm` | [WebStorm](https://www.jetbrains.com/webstorm/) | ✓ | ✓ | Discovers WebStorm on PATH or in macOS application folders; [configure a launcher](docs/reference/Reporters.md#webstorm) for a custom installation. |
216
217
 
217
218
  ### Custom Reporter
218
219