-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add playwright setup for github actions
- Loading branch information
Showing
6 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { resolve } from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { readPackageJSON } from 'pkg-types' | ||
import { isExists } from './utils.ts' | ||
|
||
const __dirname = fileURLToPath(new URL('.', import.meta.url)) | ||
|
||
async function main() { | ||
const playwrightPath = resolve(__dirname, '../node_modules/playwright') | ||
if (!await isExists(playwrightPath)) { | ||
throw new Error(`not found '${playwrightPath}'`) | ||
} | ||
|
||
const playwrightPkg = await readPackageJSON(playwrightPath) | ||
if (!playwrightPkg.version) { | ||
throw new Error(`not found 'version' in 'playwright'`) | ||
} | ||
console.log(playwrightPkg.version) | ||
} | ||
|
||
main().catch((err) => { | ||
console.error(err) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { constants as FS_CONSTANTS, promises as fs } from 'node:fs' | ||
|
||
export async function isExists(path: string) { | ||
try { | ||
await fs.access(path, FS_CONSTANTS.F_OK) | ||
return true | ||
} catch { | ||
return false | ||
} | ||
} |