Skip to content

Commit 40a2dba

Browse files
authored
feat(test): add E2E smoke tests for LFS VSCE using @wdio/vscode-service (#12)
* Adds E2E tests * fix scripts * switch to node 20 * update command names
1 parent 3ab4590 commit 40a2dba

24 files changed

+12650
-12257
lines changed

.vscode/launch.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,5 @@
5959
"${workspaceFolder}/out/test/**/*.js"
6060
]
6161
},
62-
{
63-
"name": "ReactiveVSCE Run Extension",
64-
"type": "extensionHost",
65-
"request": "launch",
66-
"args": [
67-
"--extensionDevelopmentPath=${workspaceFolder}"
68-
],
69-
"outFiles": [
70-
"${workspaceFolder}/dist/**/*.js"
71-
],
72-
"env": {
73-
"LFS_USE_REACTIVE_VSCE": "true"
74-
},
75-
"preLaunchTask": "npm: v:dev",
76-
}
7762
]
7863
}

.vscode/settings.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,4 @@
1414
"jest.jestCommandLine": "npm run v:test:reactive --",
1515
"jest.runMode": "on-demand",
1616

17-
"emeraldwalk.runonsave": {
18-
"commands": [
19-
{
20-
"match": "package.json",
21-
"isAsync": true,
22-
"cmd": "npm run v:update"
23-
}
24-
]
25-
},
2617
}

README.md

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<img src="media/bannerslim.png" style="width: 41%;" />
44
</a>
55
</p>
6-
<p align="center">Scans for unsafe contexts, hardcoded IDs, and other issues to optimize your Flows.</p>
6+
<p align="center"><i>Detect unsafe contexts, queries in loops, hardcoded IDs, and more to optimize your Salesforce Flows</i></p>
77

88
<p align="center">
99
<img src="media/demo.gif" alt="Flow Overview" width="88%" />
@@ -15,16 +15,17 @@ Use our side bar or the **Command Palette** and type `Flow Scanner` to see the l
1515

1616
* `Configure Rules` Allows to define rules and expressions as per defined in the [core documentation](https://github.com/Flow-Scanner/lightning-flow-scanner-core).
1717
* `Scan Flows` allows choosing either a directory or a selection of flows to run the analysis against.
18+
* `Calc Coverage` calculates the test coverage of Flows in the default org.
1819
* `Fix Flows` will apply available fixes automatically.
1920
* `Open Documentation` can be used to reference the documentation.
2021

2122
## Configuration
2223

2324
| Key | Description | Default Value |
2425
| ----------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------- |
25-
| `lightningFlowScanner.SpecifyFiles` | Specify flow file paths instead of a root directory. | `false` |
26-
| `lightningFlowScanner.NamingConvention` | Specify a REGEX expression to use as Flow Naming convention. | `"[A-Za-z0-9]+_[A-Za-z0-9]+"` |
27-
| `lightningFlowScanner.APIVersion` | Specify an expression to validate the API version, i.e. '===50'(use at least 50). | `">50"` |
26+
| `flowscanner.SpecifyFiles` | Specify flow file paths instead of a root directory. | `false` |
27+
| `flowscanner.NamingConvention` | Specify a REGEX expression to use as Flow Naming convention. | `"[A-Za-z0-9]+_[A-Za-z0-9]+"` |
28+
| `flowscanner.APIVersion` | Specify an expression to validate the API version, i.e. '===50'(use at least 50). | `">50"` |
2829

2930
## Development
3031

@@ -36,29 +37,51 @@ Use our side bar or the **Command Palette** and type `Flow Scanner` to see the l
3637
>
3738
> Volta will automatically use the Node.js version defined in `package.json`.
3839
39-
1. Clone the repo:
40+
1. **Clone the repository**
4041
41-
```bash
42-
git clone https://github.com/Flow-Scanner/lightning-flow-scanner-vsx.git
43-
```
44-
2. Install dependencies:
42+
```bash
43+
git clone https://github.com/Flow-Scanner/lightning-flow-scanner-vsx.git
44+
```
4545
46-
```bash
47-
npm install
48-
```
49-
3. run dev environment
46+
2. **Install Dependencies**
5047

51-
```
52-
npm run watch
53-
```
54-
4. build vsix
48+
```bash
49+
npm install
50+
```
5551

56-
```
57-
npm run build
58-
```
52+
3. **Build the Project**
5953

60-
## Contributing
54+
```bash
55+
npm run build
56+
```
6157

62-
The original `lightning-flow-scanner-vsce` package was unpublished from the Visual Studio Marketplace after a Remote Code Execution (RCE) vulnerability was identified in its core dependency, `lightning-flow-scanner-core`. This issue, caused by unsafe custom rule loading, has been fully resolved in the [v5.1.0 release of the core library](https://github.com/Flow-Scanner/lightning-flow-scanner-core/releases/tag/v5.1.0). The [lightning-flow-scanner-vsx](https://github.com/Flow-Scanner/lightning-flow-scanner-vsx) fork, focusses on security and maintainability.
58+
4. **Watch for Changes**
6359

64-
###### Want to help improve Lightning Flow Scanner? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner-core?tab=contributing-ov-file).
60+
```bash
61+
npm run watch
62+
```
63+
64+
5. **Run End-to-End Tests**
65+
66+
```bash
67+
npm run test
68+
```
69+
70+
6. **Linking** **Core Module (Optional)**
71+
72+
If you’re developing or testing updates to the core module, you can link it locally:
73+
74+
- In the core module directory, run:
75+
```bash
76+
npm run link
77+
```
78+
- In this CLI project directory, run:
79+
```bash
80+
npm link lightning-flow-scanner-core
81+
```
82+
83+
## VSCE to VSX
84+
85+
The `lightning-flow-scanner-vsce` package was unpublished from the Visual Studio and Open VSX Marketplaces due to a vulnerability in `lightning-flow-scanner-core`, stemming from unsafe rule loading. This issue was addressed in [v5 of the core library](https://github.com/Flow-Scanner/lightning-flow-scanner-core/releases/tag/v5.1.0). This fork, created on 22/09/2025, emphasizes security and maintainability.
86+
87+
<p><strong>Want to help improve Lightning Flow Scanner? See our <a href="https://github.com/Flow-Scanner/lightning-flow-scanner-core?tab=contributing-ov-file">Contributing Guidelines</a></strong></p>

beta-vscode.tsconfig.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)