Closed gyaresu closed 9 years ago
Just cloned and ran your project. You need to make a test that tests lines 6-10. %100 requires you to make tests for the port variable being evaluated below. --./lib/index.js file.-- if (typeof port === 'function') { callback = port; } else if (port === null) { port = 8000; }
But, your logic in this if else statement has some problems. Drop the ( port === null ) { port = 8000 }
// If port is a function as the below test evaluates, then the // init() method was called without a port sent. So, you need // to make the callback equal the port originally sent (the callback) and // reset the port to the correct port number. // To do this, change the first if statement to match the below: if (typeof port === 'function') { callback = port; port = 8000; }
// Then, make a test that does not send a port number
:-)
Thanks @zoe-1 & @EvanMarkHopkins you're super helpful.
I don't see the logic in having a makefile that calls npm scripts @AdriVanHoudt. It makes more sense to use npm as a way of tying all your weird bash scripts and makefiles, etc, into one uniform set of commands that the community is familiar with.
@EvanMarkHopkins you would call the makefile from package.json? The reason I do it makefile-->npm is that npm is runable on every os, while make is not installed on windows by default, also it is a standard to have your test scripts in npm. To me the makefile is a nice extra but should not be the default
I agree with putting it all, or as much as possible into package.json, and when it starts gettin too much to handle, then maybe a build.sh, or makefile would be preferable
@EvanMarkHopkins what is the pro of using a makefile that you can't do with npm?
I don't play with make very much, I think bash scripts certainly add more flexibility. I think since he already had the makefile from hapi it would have been easier to just use it. My main pain point is when I start getting really long script lines with && and calls to npm run itself, that I start thinking maybe json wasn't the optimal choice.
I just don't see the point of having a makefile here.
yeah with more complex build you need something else but that's mainly a problem for front end website building
The point I think is it teaches participants another tool which is commonly used and I am all for learning extras but it is not for everyone
@simon-p-r true, but the makefile is almost 1-to-1 replaceable with npm in this case, the syntax is just different
@AdriVanHoudt true which means I am now learning both :+1:
Okay, but I'm still saying npm should be the runner of such weird scripts, having the makefile here creating barely shorter aliases to npm run
@EvanMarkHopkins it's just an extra for people who prefer a Makefile aka Eran haha also @gyaresu sorry for taking over your PR for this discussion :p
@AdriVanHoudt is there a chat specific to this repo? I feel like General discussion pertaining to these assignments aren't entirely appropriate for Hapi's gitter either
@EvanMarkHopkins I think general hapi gitter is fine and there is a gitter for every repo on github
No. It's great. I'm really learning a lot.
I just found Eran's comments down the bottom of the Assignment 1 thread:
https://github.com/hueniverse/hueniversity/issues/1
It's something I missed and there's some good info there.
For instance the reason for the global variable internals
:
https://gist.github.com/hueniverse/a06f6315ea736ed1b46d
If we have a couple of days before the next assignment then the wiki would be worth giving some love: https://github.com/hueniverse/hueniversity/wiki
@gyaresu good point a lesson's learnt section would be helpful
Agree, also as a person not entirely familiar with github, how does a new participant go about catching up with previous assignments?
@EvanMarkHopkins you can go to the closed issues for all the previous assignments https://github.com/hueniverse/hueniversity/issues?q=is%3Aissue+is%3Aclosed
Assuming everything after this one will include testing by default, that might be a huge turn off for someone who didn't have the opportunity to take part in this assignment
@EvanMarkHopkins What he said :+1: So should we ask @hueniverse to enable Gitter? Or just pollute hapi/hapi on Gitter.
Also I agree about the hurdle for new participants.
That's why I think the README.md should point to the Wiki and we should index each Assignment.
We should also think about different levels of "hints"
So, Gitter or Freenode?
@gyaresu idk, but this is certainly something to start concidering creating an issue for
@EvanMarkHopkins @AdriVanHoudt Is it bad form to open a new issue?
Project owner to decide on chat forum: Gitter.im or Freenode
Something like that? Mention wiki format for Assignments? Other things?
@gyaresu It seems the wiki already does a pretty good job of documenting the 3rd assignment, I'd imagine it would be nice to have something similar for 1 and 2. I dont know if @zoe-1 planned on doing this or not, but an issue may encourage someone to do it. as far as new issues, the README.md implies that there would be help wanted issues, we haven't seen many, but id imagine issues are not bad form.
@gyaresu you are fully free to open issues (even better to open to much than too little)
Not complete but submitting anyway.
Can't figure out why my single test won't run.
Thanks