Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): Allow custom context and debug files #1825

Merged
merged 1 commit into from
Feb 22, 2016

Conversation

ernsheong
Copy link
Contributor

Continuation of #1586 and #1360

Potential progress/fix for #1752

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@ernsheong
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@dignifiedquire
Copy link
Member

Thanks, this looks pretty good but we need a test to ensure this works as expected. Could you take a look at the e2e tests and create one that uses a custom one and just test that is used

@ernsheong
Copy link
Contributor Author

Running "test:client" (test) task
Running /Users/<username>/Repositories/karma/bin/karma start test/client/karma.conf.js --single-run --no-auto-watch --reporters=dots
failed to add custom browserify preprocessor
{ [Error: Cannot find module 'karma/lib/preprocessor'] code: 'MODULE_NOT_FOUND' }
25 01 2016 22:41:14.225:INFO [karma]: Karma v0.13.19 server started at http://localhost:9876/
25 01 2016 22:41:14.230:INFO [launcher]: Starting browser Chrome
25 01 2016 22:41:15.261:INFO [Chrome 47.0.2526 (Mac OS X 10.11.2)]: Connected on socket /#AWU-3m1tjAEk3GmEAAAA with id 5905339
Chrome 47.0.2526 (Mac OS X 10.11.2) ERROR
  Uncaught ReferenceError: require is not defined
  at /Users/ernsheong/Repositories/karma/test/client/karma.spec.js:1
Chrome 47.0.2526 (Mac OS X 10.11.2): Executed 0 of 0 ERROR (0.066 secs / 0 secs)
[Error: failed to add custom browserify preprocessor
{ [Error: Cannot find module 'karma/lib/preprocessor'] code: 'MODULE_NOT_FOUND' }]
Fatal error: Client unit tests failed.

Hi @dignifiedquire, I will try to do that. Firstly though, can you help me with the above error message? I'm basically just trying to run grunt locally to make sure tests pass locally on master but they don't :(

@dignifiedquire
Copy link
Member

Make sure you run this before

  $ npm install
  $ rm -rf node_modules/karma
  $ cd node_modules
  $ ln -s ../ karma
  $ cd ../
  $ grunt browserify

@dignifiedquire
Copy link
Member

@ernsheong ping

@ernsheong
Copy link
Contributor Author

@dignifiedquire Hi sorry for the delay. Can you teach me how to debug within PhantomJS? Or better still, how can I use the Chrome debugger to debug the feature test?

@dignifiedquire
Copy link
Member

You can specify temporary to use Chrome in the feature test like this: https://github.com/karma-runner/karma/blob/master/test/e2e/basic.feature#L23-L38

@ernsheong
Copy link
Contributor Author

Sorry, I'm stuck. (not a Node guy, more front end). How can I debug the lib/config.js, or the karma.js middleware file. The browser does not have that JS file loaded within it.

@dignifiedquire
Copy link
Member

@ernsheong all code in /lib is run in node, and all code in /client is run in the browser. What exactly are you trying to debug? You can try just adding console.log statements in lib/config.js if you need to check simple things.

@ernsheong
Copy link
Contributor Author

Most of the path resolution and logic happens on the Node side. Something is not wired up right as I am unable to get the test to pass. Another eye would be helpful.

@fredericoschardong
Copy link

@ernsheong I made a PR to your repository with the changes needed to pass the test. I am having some issues with PhantomJS on my machine and was only able to test my changes using Chrome. Please let me know if they don't work.

@ernsheong
Copy link
Contributor Author

@dignifiedquire I finally got it to work! There was some weirdness for the cucumber mocha test, but I found a way to make it work...

@dignifiedquire
Copy link
Member

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants