Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

12-07-2014 , 05:33 PM
Quote:
Originally Posted by suzzer99
But Google-fu only gets you so far on something like node, angular or karma unit testing if you don't have access to a live person with a lot more experience than you.
I love video tutorial sites. They aren't the most efficient way to learn but they're enjoyable. They also introduce all the new terminology in whatever you want to learn so when you hit the actual documentation it is less overwhelming.

http://www.learnallthenodes.com/epis...ting-in-nodejs

https://www.youtube.com/watch?v=BwNMUVzo3vs

Youtube has tons of content from talks and people just putting up live coding sessions etc. There are also paid sites like pluralsight and tutsplus that put out tons of content.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 05:41 PM
Quote:
Originally Posted by Shoe Lace
suzzer,

Didn't we talk about node/express stuff a few years ago? What's wrong with picking one of the frameworks out there and actually start writing the tests? Who cares what everyone says is best or not.

If you want a sure fire way to get stuff done, just look at TJ's github repo. He has like 50 node modules that are all tested with Mocha and express alone has a toooon of tests.
That's all basically what I'm doing – and what I have to do next week. I will check out TJ's github. I've looked at some other repos, read a bunch of articles questioning how to do mock data within express, whether or not to use dependency injection, etc. It's this kind of stuff that troubles me: http://stackoverflow.com/questions/9...s-with-express

Quote:
I've come to the conclusion that the only way to really unit test express applications is to maintain a lot of separation between the request handlers and your core logic.

Thus, your application logic should be in separate modules that can be required and unit tested, and have minimal dependence on the Express Request and Response classes as such.

Then in the request handlers you need to call appropriate methods of your core logic classes.

I'll put an example up once I've finished restructuring my current app!

I guess something like this? (Feel free to fork the gist or comment, I'm still exploring this).
But anyway – none of that was the point of my post. The point of my post is I want to just know all the stuff without having to scratch my head for weeks learning it – and going down to many wrong paths before eventually learning a year later that I should've done a bunch of stuff differently. That kind of stuff used to be fun, it's not anymore. I'm just wondering if others have the same experience.

I've actually got a whole lot of other stuff going on in my life right now that I am kind of overwhelmed by. That's probably contributing more to this feeling of dread and lack of intellectual energy than anything else.

Last edited by suzzer99; 12-07-2014 at 05:49 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 05:43 PM
I would just start here,
https://github.com/strongloop/express/tree/master/test

I think the author's tests for the framework you're testing will be the best source of info available. I'm pretty sure he and the author of socket.io also made an express book? I didn't check it out though.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 05:43 PM
Quote:
Originally Posted by e i pi
I love video tutorial sites. They aren't the most efficient way to learn but they're enjoyable. They also introduce all the new terminology in whatever you want to learn so when you hit the actual documentation it is less overwhelming.

http://www.learnallthenodes.com/epis...ting-in-nodejs

https://www.youtube.com/watch?v=BwNMUVzo3vs

Youtube has tons of content from talks and people just putting up live coding sessions etc. There are also paid sites like pluralsight and tutsplus that put out tons of content.
Yeah the angular videos are really helpful. I haven't found any videos yet on this subject though.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 05:46 PM
Quote:
Originally Posted by Shoe Lace
I would just start here,
https://github.com/strongloop/express/tree/master/test

I think the author's tests for the framework you're testing will be the best source of info available. I'm pretty sure he and the author of socket.io also made an express book? I didn't check it out though.
Yeah I did start there and it's definitely helped. But things seem to get weird when you have your own framework on top of express and need to do stuff like mock the req/res object or test routing. But maybe after next week that won't seem so weird.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 05:49 PM
Quote:
Originally Posted by suzzer99
Yeah I did start there and it's definitely helped. But things seem to get weird when you have your own framework on top of express and need to do stuff like mock the req/res object or test routing. But maybe after next week that won't seem so weird.
There's hundreds of tests which test the routing here, they are under acceptance tests:
https://github.com/strongloop/expres...est/acceptance

If that's not enough can this help for mocking http objects?
https://github.com/howardabrams/node-mocks-http

I never used it before tho. I just Googled for "express mock req test".
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 05:56 PM
Quote:
Originally Posted by suzzer99
Yeah the angular videos are really helpful. I haven't found any videos yet on this subject though.
The youtube video I linked is titled "Unit Testing Express Middleware / TDD with Express and Mocha" is this not the problem in question?

The obvious way to get answers is to go on irc/twitter and start saying "node.js sucks, you can't even unit test it". People will go above and beyond to prove you wrong.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 06:09 PM
Quote:
Originally Posted by e i pi
The obvious way to get answers is to go on irc/twitter and start saying "node.js sucks, you can't even unit test it". People will go above and beyond to prove you wrong.
lol.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 06:12 PM
Quote:
Originally Posted by e i pi
The youtube video I linked is titled "Unit Testing Express Middleware / TDD with Express and Mocha" is this not the problem in question?

The obvious way to get answers is to go on irc/twitter and start saying "node.js sucks, you can't even unit test it". People will go above and beyond to prove you wrong.
I'm starting here and working my way up to Twitter
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 06:14 PM
Stupid question maybe but do people really "get" the time to do this stuff? In other words you have stories in sprints which are "investigate node unit testing"? Cause I sure as **** don't get that - a few months ago I had to spend a saturday converting our workflow to gulp & sass from this terrible built in less compiler. Of course thats one of the reasons I'm looking again.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 06:23 PM
I put 40 hours for it in our project plan. We're in "sprint zero" or it would be much harder.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 08:48 PM
Quote:
Originally Posted by suzzer99
I have a feeling my bosses would be content to basically go down the same road of just talking about testing. They love to make PowerPoint slides about how awesome things are going to be when we have true CI/CD. But when the rubber meets the road they never really do anything or commit any resources (I still have a completely full workload, and no official deliverables when it comes to testing). If CI/CD is walking, we're still struggling to hold our heads up.
Super standard. Both places I've worked have had unit testing - with specific test frameworks - included in the required expertise section in the job ad, then when I've joined the company it's turned out to pretty much be a unit testing free zone.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 09:50 PM
Yuck. So, I have my machine up and running again. Unfortunately, I couldn't retrieve about 50% of the work I had already done since it was never pushed. Also found that the eBay API changed the JSON tree and several tag names, so the whole system crashes.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-07-2014 , 10:32 PM
suzzer,

Sorry to continue the derail, but I'm curious.. why did your company think it was a good idea to switch your site to run on node in the first place? I know nothing about node, so are there certain features that made it the right choice even with all of the potential difficulties in using a new technology? Granted hindsight is 20/20, but the lack of good resources and experienced developers you mentioned seem like a given with such a new platform. It just seems strange that your company was seemingly so intent on using node, seeking out a number of high-priced consultants, recruiting new hires, etc. Who or what was the driving force behind that?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 05:52 AM
Quote:
Originally Posted by suzzer99
But anyway – none of that was the point of my post. The point of my post is I want to just know all the stuff without having to scratch my head for weeks learning it – and going down to many wrong paths before eventually learning a year later that I should've done a bunch of stuff differently. That kind of stuff used to be fun, it's not anymore. I'm just wondering if others have the same experience.
I've hit that point not too long ago. Maybe a year or two ago. So you're definitely not alone.

(Warning TL;DR incoming, skip the rest of this post if you have no use for a woe-is-me rant.)
In addition to that, two things cooked over more or less at the same time.

First, my last project was a horrible mess. Code from the 90's that every now and again has been sorta semi-converted to newer paradigms in some spots. So ya, not pretty.
When I was hired to the project, I got interviewed on a group of design patterns and testing stuff. None of which applied to that project.
Couldn't get support from management to get the help our group of coders needed to make any meaningful headway on a project timeline that was utterly unrealistic to begin with (and management knew that fully well yet refused to adjust it).
I ended up cancelling the contract utilising the probation period dead lines (1d notice). First time in my entire career that I had to wave the white flag.

Secondly, I started to realise more and more that I do miss direct feedback from the people who are actually (hopefully) being helped by my coding. Pretty selfish to want that pat on your back, but ya I missed that.
It's easy to get solid work done on a good day. On bad days, I was increasingly lacking the motivation to do my very best.

So I ended up quitting coding for the time being and moved into two other completely different part-time jobs to get some distance from that.
I'll have the option to return if I change my mind within the next few years, however, I have no intention of doing so.

Ah, and on a side note, I never had the slightest urge whatsoever to move into soft-dev/project management myself. I am positive such a job would burn me out within a very short period of time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 10:55 AM
I've been looking around for a couple guides on setting up a LAMP stack in a virtual machine, and I've found one saying to use Ubuntu destkop, and one saying to use Ubuntu server. Which is more commonly used? Surely Ubuntu server, yes? Or does it even matter since Apache is the web server?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 11:29 AM
Quote:
Originally Posted by suzzer99
The point of my post is I want to just know all the stuff without having to scratch my head for weeks learning it – and going down to many wrong paths before eventually learning a year later that I should've done a bunch of stuff differently. That kind of stuff used to be fun, it's not anymore. I'm just wondering if others have the same experience.

Trudging through difficulties to learn new things definitely frustrates me,. it probably frustrates everyone. But think about it, difficulty is what make skills valuable. If you could plug an ethernet cord into your brain and download programming skills from the internet, that would mean everyone in the world could do it. Everyone in the world can breathe, and how many people get paid to do that?

You said there's no book on what you're trying to learn, so what you're going through in learning it must be very difficult, and I definitely empathize with you. You should document your struggles, and write that book once you've reached the end of the path you're on.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 01:57 PM
Learning new things keeps the brain young.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 03:01 PM
Quote:
Originally Posted by n00b590
suzzer,

Sorry to continue the derail, but I'm curious.. why did your company think it was a good idea to switch your site to run on node in the first place? I know nothing about node, so are there certain features that made it the right choice even with all of the potential difficulties in using a new technology? Granted hindsight is 20/20, but the lack of good resources and experienced developers you mentioned seem like a given with such a new platform. It just seems strange that your company was seemingly so intent on using node, seeking out a number of high-priced consultants, recruiting new hires, etc. Who or what was the driving force behind that?
It's a very reasonable question that I think I've answered before itt, but a while back. Basically the company decided to wrap our back end business logic and myriad of internal service connections behind an API that could be a consumed by a web app, native app, or possible 3rd party apps/sites/devices in the future. Most of that stuff now is handled through the standard corporate Oracle/Weblogic stack, built on ATG framework. It's extremely unflexible.

So we knew that we were going to have an API backend which could return either JSON or XML, and a web layer which when everything we have now was converted over - would probably be some single page apps, hybrid SPA/standard apps, and a lot of lazy-loaded JSON stuff. The only question was what to use for the web layer. Even though we didn't have much experience with node, it still made a lot more sense to us than weblogic or PHP or something - since we were going to have JSON in/JSON out in a lot of places.

Also myspace, paypal and some other companies had implemented industrial scale node web layers to great success - so that was enough to convince the corporate brass to give it a shot (just barely). Bill Scott - who is something of a node evangelist who got started with Netflix and now works at paypal - came and spoke to us as well.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 03:06 PM
Quote:
Originally Posted by Anais
Learning new things keeps the brain young.
Yeah I think so. It's like exercising your brain.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 03:09 PM
Quote:
Originally Posted by e i pi
The youtube video I linked is titled "Unit Testing Express Middleware / TDD with Express and Mocha" is this not the problem in question?
Wow somehow I missed this the first time and your videos. I am really not all there right now. I will check them out, thanks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 04:13 PM
Quote:
Originally Posted by suzzer99
Yeah I think so. It's like exercising your brain.
neuroscientists agree
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 06:30 PM
Yeah that's good to know. It feels like exercise because it more or less is.

The brain stuff adds some extra motivation for me. Thanks for posting!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 06:39 PM
Have you looked to see what Walmart has available?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-08-2014 , 07:54 PM
Eran Hammer and people from his team love the **** out of node and seem to have a similar use case for connecting node to a bunch of disparate systems.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m