From a0eeb415f29ebc0e57fcaffd1d8b66f18f071650 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 7 Jul 2017 13:08:36 -0700 Subject: [PATCH] Introduce `yarn debug-unit` command The command runs the puppeteer testsuite with the '--inspect-brk' node flag. This makes it possible to connect to the testsuite with Chrome DevTools and debug it. Fixes #57. --- package.json | 1 + test/test.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e48c89e3..a3de7d73 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ }, "scripts": { "unit": "jasmine test/test.js", + "debug-unit": "DEBUG_TEST=true node --inspect-brk ./node_modules/.bin/jasmine test/test.js", "test-phantom": "python third_party/phantomjs/test/run-tests.py", "test": "npm run lint --silent && npm run unit && npm run test-phantom", "install": "node install.js", diff --git a/test/test.js b/test/test.js index 6834c15c..37301e43 100644 --- a/test/test.js +++ b/test/test.js @@ -23,7 +23,10 @@ let PORT = 8907; let STATIC_PREFIX = 'http://localhost:' + PORT; let EMPTY_PAGE = STATIC_PREFIX + '/empty.html'; -jasmine.DEFAULT_TIMEOUT_INTERVAL = 10 * 1000; +if (process.env.DEBUG_TEST) + jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 1000 * 1000; +else + jasmine.DEFAULT_TIMEOUT_INTERVAL = 10 * 1000; describe('Puppeteer', function() { let browser;