Skip to content

Commit a447a12

Browse files
feat: support EDGE_BINARY_PATH env variable
1 parent 2520b46 commit a447a12

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- uses: actions/checkout@v3
19+
1920
- name: 💚 Use Node.js
2021
uses: actions/setup-node@v3
2122
with:
2223
node-version: 20
24+
2325
- name: 🚧 Install Dependencies
2426
run: npm ci
27+
2528
- name: 📦 Build
2629
run: npm run build
30+
31+
- name: 🔧 Install Edge
32+
id: edge
33+
uses: browser-actions/setup-edge@v1
34+
2735
- name: 🧪 Run Tests
2836
uses: GabrielBB/xvfb-action@v1
37+
env:
38+
EDGE_BINARY_PATH: ${{ steps.edge.outputs.edge-path }}
2939
with:
3040
run: npm test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ __Returns:__ `string` - path to Edgedriver binary
8686

8787
### `findEdgePath`
8888

89-
The `findEdgePath` is a helper method to find the Microsoft Egde binary on given system.
89+
The `findEdgePath` is a helper method to find the Microsoft Egde binary on given system. If there is a `EDGE_BINARY_PATH` environment set, it will return that value.
9090

9191
__Returns:__ `string` - path to Microsoft Edge binary
9292

src/finder.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ function findEdgeExecutables(folder: string) {
164164
}
165165

166166
export default () => {
167+
/**
168+
* Check for the EDGE_BINARY_PATH env variable
169+
*/
170+
const binaryPathEnv = process.env.EDGE_BINARY_PATH
171+
if (typeof binaryPathEnv === 'string' && binaryPathEnv) {
172+
return process.env.EDGE_BINARY_PATH
173+
}
174+
167175
if (os.platform() === 'win32') {
168176
return win32()[0]
169177
}

0 commit comments

Comments
 (0)