outmoded / university

Community learning experiment
Other
371 stars 194 forks source link

Assignment 3: #102

Closed gyaresu closed 9 years ago

gyaresu commented 9 years ago

Not complete but submitting anyway.

Can't figure out why my single test won't run.

Thanks

zoe-1 commented 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; }

zoe-1 commented 9 years ago

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

zoe-1 commented 9 years ago

:-)

gyaresu commented 9 years ago

Thanks @zoe-1 & @EvanMarkHopkins you're super helpful.

ghost commented 9 years ago

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.

AdriVanHoudt commented 9 years ago

@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

ghost commented 9 years ago

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

AdriVanHoudt commented 9 years ago

@EvanMarkHopkins what is the pro of using a makefile that you can't do with npm?

ghost commented 9 years ago

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.

ghost commented 9 years ago

I just don't see the point of having a makefile here.

AdriVanHoudt commented 9 years ago

yeah with more complex build you need something else but that's mainly a problem for front end website building

simon-p-r commented 9 years ago

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

AdriVanHoudt commented 9 years ago

@simon-p-r true, but the makefile is almost 1-to-1 replaceable with npm in this case, the syntax is just different

simon-p-r commented 9 years ago

@AdriVanHoudt true which means I am now learning both :+1:

ghost commented 9 years ago

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 seems pointless

AdriVanHoudt commented 9 years ago

@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

ghost commented 9 years ago

@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

AdriVanHoudt commented 9 years ago

@EvanMarkHopkins I think general hapi gitter is fine and there is a gitter for every repo on github

gyaresu commented 9 years ago

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

AdriVanHoudt commented 9 years ago

@gyaresu good point a lesson's learnt section would be helpful

ghost commented 9 years ago

Agree, also as a person not entirely familiar with github, how does a new participant go about catching up with previous assignments?

AdriVanHoudt commented 9 years ago

@EvanMarkHopkins you can go to the closed issues for all the previous assignments https://github.com/hueniverse/hueniversity/issues?q=is%3Aissue+is%3Aclosed

ghost commented 9 years ago

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

gyaresu commented 9 years ago

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

ghost commented 9 years ago

@gyaresu idk, but this is certainly something to start concidering creating an issue for

gyaresu commented 9 years ago

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

ghost commented 9 years ago

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

AdriVanHoudt commented 9 years ago

@gyaresu you are fully free to open issues (even better to open to much than too little)