karma-runner / karma-phantomjs-launcher

A Karma plugin. Launcher for PhantomJS.
MIT License
281 stars 131 forks source link

Cannot get debug option to activate #132

Open joallard opened 8 years ago

joallard commented 8 years ago

This is probably a documentation issue, but I cannot for the life of me get the debug option to activate. I'm new to the karma platform, and I'm having an excruciating time getting done what is simple in other languages I won't name.

In karma.conf.js. Attempt n.1:

customLaunchers: {
  phantomJS: {debug: true}
}
$ karma start
WARN [config]: Can not define launcher PhantomJS. Missing base launcher.
INFO [karma]: Karma v0.12.37 server started at http://localhost:8888/
INFO [launcher]: Starting browser PhantomJS

$ karma start --browsers PhantomJS
WARN [config]: Can not define launcher PhantomJS. Missing base launcher.
INFO [karma]: Karma v0.12.37 server started at http://localhost:8888/
INFO [launcher]: Starting browser PhantomJS

Attempts n.2, 3, 4 with varying cases of phantomJs.

Attempt 5:

phantomjsLauncher: {debug: true}
$ karma start
INFO [karma]: Karma v0.12.37 server started at http://localhost:8888/
INFO [launcher]: Starting browser PhantomJS
# debugger statement ignored, that probably did nothing

Attempt 6:

customLaunchers: {
  base: 'PhantomJS',
  debug: true
}
$ karma start
# no idea what's here
# infinity lives here
at Array.invoke ($PROJECT_PATH/node_modules/di/lib/injector.js:75:15)
at [object Object].get ($PROJECT_PATH/node_modules/di/lib/injector.js:48:43)
at module.(anonymous function) ($PROJECT_PATH/node_modules/karma/lib/config.js:180:56)
at Array.invoke ($PROJECT_PATH/node_modules/di/lib/injector.js:75:15)
at [object Object].get ($PROJECT_PATH/node_modules/di/lib/injector.js:48:43)
at module.(anonymous function) ($PROJECT_PATH/node_modules/karma/lib/config.js:180:56)
at Array.invoke ($PROJECT_PATH/node_modules/di/lib/injector.js:75:15)
at [object Object].get ($PROJECT_PATH/node_modules/di/lib/injector.js:48:43)
at module.(anonymous function) ($PROJECT_PATH/node_modules/karma/lib/config.js:180:56)
at Array.invoke ($PROJECT_PATH/node_modules/di/lib/injector.js:75:15)
at [object Object].get ($PROJECT_PATH/node_modules/di/lib/injector.js:48:43)
at module.(anonymous function) ($PROJECT_PATH/node_modules/karma/lib/config.js:180:56)
at Array.invoke ($PROJECT_PATH/node_modules/di/lib/injector.js:75:15)
at [object Object].get ($PROJECT_PATH/node_modules/di/lib/injector.js:48:43)
at $PROJECT_PATH/node_modules/karma/lib/launcher.js:57:72
at Array.forEach (native)
at [object Object].launch ($PROJECT_PATH/node_modules/karma/lib/launcher.js:40:11)
at [object Object].invoke ($PROJECT_PATH/node_modules/di/lib/injector.js:75:15)
at Server.<anonymous> ($PROJECT_PATH/node_modules/karma/lib/server.js:62:18)
at Server.g (events.js:260:16)
at emitNone (events.js:72:20)
at Server.emit (events.js:166:7)
at emitListeningNT (net.js:1260:10)
at doNTCallback1 (node.js:441:9)
at process._tickCallback (node.js:363:17)

Attempt 7:

customLaunchers: {
  expletiveRedacted: {
    debug: true,
    base: 'PhantomJS'
  }
},
browsers: ['expletiveRedacted']
$ karma start
INFO [karma]: Karma v0.12.37 server started at http://localhost:8888/
INFO [launcher]: Starting browser PhantomJS
# not a single foo given about the debug option
# this is my hell

Verbal commands don't seem to be working either. Please advise.

joallard commented 8 years ago

Aaand I had a version outdated by > 1 yr.

joallard commented 8 years ago

Re-opening, only attempt 7 works. How do I change the option without creating a new launcher?

joallard commented 8 years ago

sigh

$ karma start --browsers=expletiveRedacted
INFO [karma]: Karma v0.12.37 server started at http://localhost:8888/
INFO [launcher]: Starting browser PhantomJS
INFO [phantomjs.launcher]: ACTION REQUIRED:
INFO [phantomjs.launcher]:
INFO [phantomjs.launcher]:   Launch browser at
INFO [phantomjs.launcher]:   http://localhost:9000/webkit/inspector/inspector.html?page=2
INFO [phantomjs.launcher]:
INFO [phantomjs.launcher]: Waiting 15 seconds ...
  1. Open Chrome at said page
  2. Click anywhere in makeshift debugger
  3. Nothing happens in console
  4. Can't see any script, much less 'debugger' statement
  5. 15 second window closes down, script ends

Expected: For debugged script to be debuggable

draganHR commented 8 years ago

Same problem here.
I'm using webpack + babel (karma-webpack), i'm not sure if that is relevant here.

brunocascio commented 7 years ago

Same problem