electron-playwright-helpers
Advanced tools
Comparing version 1.1.1 to 1.1.2
/** | ||
* Parses the `out` directory to find the latest build of your Electron project. | ||
* Use `npm run package` (or similar) to build your app prior to testing. | ||
* | ||
* @param buildDirectory {string} the directory to search for the latest build | ||
* (path/name relative to package root or full path starting with /). Defaults to `out`. | ||
* @returns {string} - path to the most recently modified build directory | ||
*/ | ||
export declare function findLatestBuild(): string; | ||
export declare function findLatestBuild(buildDirectory?: string): string; | ||
declare type Architecture = 'x64' | 'x32' | 'arm64' | undefined; | ||
@@ -9,0 +10,0 @@ /** |
@@ -32,10 +32,13 @@ "use strict"; | ||
* Use `npm run package` (or similar) to build your app prior to testing. | ||
* | ||
* @param buildDirectory {string} the directory to search for the latest build | ||
* (path/name relative to package root or full path starting with /). Defaults to `out`. | ||
* @returns {string} - path to the most recently modified build directory | ||
*/ | ||
function findLatestBuild() { | ||
function findLatestBuild(buildDirectory = 'out') { | ||
// root of your project | ||
const rootDir = path_1.default.resolve('./'); | ||
// directory where the builds are stored | ||
const outDir = path_1.default.join(rootDir, 'out'); | ||
const outDir = buildDirectory.startsWith('/') | ||
? buildDirectory | ||
: path_1.default.join(rootDir, buildDirectory); | ||
// list of files in the out directory | ||
@@ -42,0 +45,0 @@ const builds = fs_1.default.readdirSync(outDir); |
{ | ||
"name": "electron-playwright-helpers", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Helper functions for Electron end-to-end testing using Playwright", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -76,3 +76,3 @@ # Electron Playwright Helpers | ||
<dl> | ||
<dt><a href="#findLatestBuild">findLatestBuild()</a> ⇒ <code>string</code></dt> | ||
<dt><a href="#findLatestBuild">findLatestBuild(buildDirectory)</a> ⇒ <code>string</code></dt> | ||
<dd><p>Parses the <code>out</code> directory to find the latest build of your Electron project. | ||
@@ -155,3 +155,3 @@ Use <code>npm run package</code> (or similar) to build your app prior to testing.</p></dd> | ||
## findLatestBuild() ⇒ <code>string</code> | ||
## findLatestBuild(buildDirectory) ⇒ <code>string</code> | ||
<p>Parses the <code>out</code> directory to find the latest build of your Electron project. | ||
@@ -164,2 +164,7 @@ Use <code>npm run package</code> (or similar) to build your app prior to testing.</p> | ||
</ul> | ||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| buildDirectory | <code>string</code> | <code>"out"</code> | <p>the directory to search for the latest build (path/name relative to package root or full path starting with /). Defaults to <code>out</code>.</p> | | ||
<a name="parseElectronApp"></a> | ||
@@ -166,0 +171,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88011
1042
442