mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-01 20:39:57 -05:00
chore: merge develop to feat/protocol
This commit is contained in:
@@ -88,6 +88,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => {
|
||||
'@swc/core',
|
||||
'emitter',
|
||||
'ts-loader',
|
||||
'@babel/preset-typescript/package.json',
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
|
||||
function delay (n) {
|
||||
return new Promise((resolve) => setTimeout(resolve, n))
|
||||
}
|
||||
|
||||
async function waitUntilExists (dir, { freq, maxAttempts }, numAttempts = 0) {
|
||||
const exists = await fs.pathExists(dir)
|
||||
|
||||
if (exists) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (numAttempts > maxAttempts) {
|
||||
throw Error(`Failed to detect path at ${dir} after ${maxAttempts}.`)
|
||||
}
|
||||
|
||||
console.log(`[@packages/runner/webpack.config.ts]: ${dir} not found. Will check again in ${freq}ms. Attempt: ${numAttempts}/${maxAttempts}`)
|
||||
|
||||
await delay(freq)
|
||||
|
||||
return waitUntilExists(dir, { freq, maxAttempts }, numAttempts + 1)
|
||||
}
|
||||
|
||||
async function waitUntilIconsBuilt () {
|
||||
await waitUntilExists(path.join(__dirname, '..', 'packages', 'icons', 'dist', 'favicon'), { freq: 1000, maxAttempts: 10 })
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
waitUntilIconsBuilt,
|
||||
}
|
||||
Reference in New Issue
Block a user