Skip to content

Commit ec0057f

Browse files
committed
Use proper method
1 parent b727751 commit ec0057f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/helpers.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,16 @@ export async function application(workingDir, quietMode=false, logFile=undefined
170170
LOG_FILE: logFile
171171
};
172172

173+
173174
let a = await playwright.launch({
174175
path: electron,
175176
args: [path.join(__dirname, "..", "output", "main.js")],
176177
env: env
177178
});
178179

180+
179181
a.logData = [];
180-
182+
181183
a.on("window", (w) => {
182184
w.on("console", (payload) => {
183185
a.logData.push(payload);
@@ -193,10 +195,12 @@ export async function application(workingDir, quietMode=false, logFile=undefined
193195
}
194196

195197
export async function dumpOutput(app) {
196-
console.log(app.logData);
197-
app.logData = [];
198+
if (app) {
199+
console.log(app.logData);
200+
app.logData = [];
201+
}
198202

199-
if (path.existsSync(logPath)) {
203+
if (fs.existsSync(logPath)) {
200204
console.log(fs.readFileSync(logPath));
201205
}
202206
}

0 commit comments

Comments
 (0)