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.
This commit is contained in:
Andrey Lushnikov 2017-07-07 13:08:36 -07:00
parent 193f0d85cb
commit a0eeb415f2
2 changed files with 5 additions and 1 deletions

View File

@ -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",

View File

@ -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;