From e9cab0a8cfe19c578f83e00d351be8f5701d996c Mon Sep 17 00:00:00 2001 From: MarieMalarme Date: Thu, 18 Jun 2020 15:32:04 +0100 Subject: [PATCH] Added an option to open the browser when testing locally. (#612) --- dom/test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dom/test.js b/dom/test.js index 1523a8667..8957816dc 100644 --- a/dom/test.js +++ b/dom/test.js @@ -8,7 +8,7 @@ const exercise = process.argv[2] if (!exercise) throw Error(`usage: node test EXERCISE_NAME`) const PORT = 9898 const config = { - args: [ + args: [ '--no-sandbox', '--disable-setuid-sandbox', @@ -16,6 +16,7 @@ const config = { // because Docker’s default for /dev/shm is 64MB '--disable-dev-shm-usage', ], + headless: !process.env.SOLUTION_PATH, } const solutionPath = process.env.SOLUTION_PATH || '/jail/student' @@ -40,13 +41,13 @@ const server = http const stream = fs .createReadStream(filepath) .pipe(response) - .once('error', (err) => { + .once('error', err => { console.log(err) response.statusCode = 500 // handle 404 ? response.end('oopsie') }) }) - .listen(PORT, async (err) => { + .listen(PORT, async err => { let browser, code = 0 try {