Skip to content

Commit

Permalink
Use proper method
Browse files Browse the repository at this point in the history
  • Loading branch information
muffinista committed Feb 9, 2024
1 parent b727751 commit 7b7f6c1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,18 @@ export async function application(workingDir, quietMode=false, logFile=undefined
LOG_FILE: logFile
};

console.log(env);


let a = await playwright.launch({
path: electron,
args: [path.join(__dirname, "..", "output", "main.js")],
env: env
});


a.logData = [];

a.on("window", (w) => {
w.on("console", (payload) => {
a.logData.push(payload);
Expand All @@ -193,10 +197,12 @@ export async function application(workingDir, quietMode=false, logFile=undefined
}

export async function dumpOutput(app) {
console.log(app.logData);
app.logData = [];
if (app) {
console.log(app.logData);
app.logData = [];
}

if (path.existsSync(logPath)) {
if (fs.existsSync(logPath)) {
console.log(fs.readFileSync(logPath));
}
}
Expand Down

0 comments on commit 7b7f6c1

Please sign in to comment.