playwright.globalSetup.ts 1.0 KB

12345678910111213141516171819202122232425262728
  1. // kilocode_change - new file
  2. import { downloadAndUnzipVSCode } from "@vscode/test-electron/out/download.js"
  3. import * as path from "path"
  4. import * as fs from "fs"
  5. import { fileURLToPath } from "url"
  6. const __filename = fileURLToPath(import.meta.url)
  7. const __dirname = path.dirname(__filename)
  8. export default async () => {
  9. const workspaceRoot = path.resolve(__dirname, "../..")
  10. const vscodeTestDir = path.join(workspaceRoot, ".docker-cache", "vscode")
  11. await fs.promises.mkdir(vscodeTestDir, { recursive: true })
  12. console.log(`Using VS Code cache directory: ${vscodeTestDir}`)
  13. console.log("Downloading VS Code stable...")
  14. const vscodePath = await downloadAndUnzipVSCode({ version: "stable", cachePath: vscodeTestDir })
  15. // Store the VS Code executable path for tests to use
  16. process.env.VSCODE_EXECUTABLE_PATH = vscodePath
  17. console.log(`VS Code executable path: ${vscodePath}`)
  18. // console.log("Downloading VS Code insiders...")
  19. // await downloadAndUnzipVSCode({ version: "insiders", cachePath: vscodeTestDir })
  20. console.log("VS Code downloads completed!")
  21. }