Skip to content

Commit

Permalink
Ensure documents folder exists when running CI
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Dec 24, 2024
1 parent 09004b6 commit 0d73510
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions playwright.setup.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { spawn } from 'node:child_process';
import { existsSync, mkdirSync } from 'node:fs';
import path from 'node:path';

async function globalSetup() {
console.log('Playwright globalSetup called');

return new Promise<void>((resolve, reject) => {
// HACK: Force graphics card check to pass
process.env.CI = '1';

// Documents dir in CI
if (!process.env.USERPROFILE) throw new Error('USERPROFILE not set');
const documents = path.join(process.env.USERPROFILE, 'Documents');
if (!existsSync(documents)) mkdirSync(documents);

const electron = spawn('node', ['./scripts/launchCI.js']);

electron.on('close', () => {
Expand Down

0 comments on commit 0d73510

Please sign in to comment.