@approval-tests/approvals 7.5.14 → 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.
|
@@ -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
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
|
|