Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Add "debug" argument for straightforward debugging #43

Merged
merged 1 commit into from
May 25, 2015

Conversation

mpderbec
Copy link

I found it really difficult to debug tests with Karma and PhantomJS, and I saw others struggling too so I modified the code to make it easier. There may be better ways to do this but it worked for me and everything else seems really brittle.

@mpderbec mpderbec changed the title Add "debug" argument for straightforward debugger Add "debug" argument for straightforward debugging Sep 19, 2014
@robertlevy
Copy link

+1

4 similar comments
@OliverKK
Copy link

OliverKK commented Dec 1, 2014

+1

@chrisvdp
Copy link

chrisvdp commented Jan 5, 2015

+1

@ascudder
Copy link

ascudder commented Jan 5, 2015

+1

@adelyte-chris
Copy link

+1

@dignifiedquire
Copy link
Member

Thank you, I like this a lot but could you please do the following changes:

  • Use the karma logger instead of requiring grunt
  • Squash all commits into one
  • Change the commit message according to our convention

@mpderbec
Copy link
Author

Ok I think I have addressed all three things, please let me know if I've done any of them incorrectly.

" }\n" +
" debugPage();\n" +
"}(phantom));\n" +
"\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of having that much code in quotes, how about you put this into a separate file and then do something like this:

// capture.template
..
page.open('<%= url %>');
..

// ---
fs.readFile('./templates/capture.js', function (err, file) {
  captureCode = _.template(file.toString(), {url: url})
})

@mpderbec
Copy link
Author

I've moved the template code into its own file, added underscore.js and tested on Windows and Ubuntu. Let me know if there's anything else.

@dignifiedquire
Copy link
Member

Thanks, much better :) One last nitpick please use lodash instead of underscore to keep it consistent with the rest of the karma code base.

move debugPage code into a template file

remove debug logging code

move underscore from devDependencies to dependencies

switch from underscore library to lodash
@mpderbec
Copy link
Author

Done: underscore --> lodash

@dignifiedquire
Copy link
Member

LGTM

@mpderbec
Copy link
Author

I'm not sure if there's anything more I should do... I can't merge it myself, right?

dignifiedquire added a commit that referenced this pull request May 25, 2015
Add "debug" argument for straightforward debugging
@dignifiedquire dignifiedquire merged commit 1983a3c into karma-runner:master May 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants