Testing MEAN Apps With Javascript

On March 18th, I presented “Testing MEAN Apps With Javascript” to the Indy.JS meetup group. The room was packed as we covered the basics of why we do developer testing, and how to test apps that are built with Mongo, Angular, Express, and Node. Most of the code was devoted to showing how to test Mongoose models, Express routes and controllers, and Node functions with Mocha and Sinon. Here is the slide deck (written with reveal.js):

Full size slides

Some supporting comments

Some comments from the slides (in my super-secret speaker deck…):

What is testing?

You already do testing, probably on at least a manual basis.

Read on →

Debugging and Fixing Local Karma PhantomJS Issue

Debugging and Fixing Local Karma PhantomJS Issue

Using Karma for a client AngularJS project. Technically there is only one Karma test (a stub success test) since we haven’t gotten around to using that yet. But it is set up and part of our test build chain. Using Mocha for Node tests (controllers, models) and Protractor for end-to-end testing.

So I am running Karma locally, and all of a sudden getting some PhantomJS issues. The results look something like:

$ grunt test:karma --debug
Running "env:test" (env) task
[D] Task source: myproject/node_modules/grunt-env/tasks/env.js

Running "karma:unit" (karma) task
[D] Task source: myproject/node_modules/grunt-karma/tasks/grunt-karma.js
INFO [karma]: Karma v0.12.23 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start PhantomJS again (1/2).
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start PhantomJS again (2/2).
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
ERROR [launcher]: PhantomJS failed 2 times (timeout). Giving up.
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.

It would try again after a bit and continually fail. The continuous integration server and other developers’ machines are working just fine. Usually you hear “works on my machine”. Well in this case, it didn’t work on my machine, but worked everywhere else.

Read on →

Blog Changes Afoot

Hey there, loyal blog reader! I wanted to tell you about some exciting changes that I have in the works for my blog. And, no, this is not Our Incredible Journey. :)

Domain change

My blog was previously called “22 Idea Street”. This was a name I mostly arbitrarily chose in 2008. Back in 2012, a movie called “21 Jump Street” was released, followed by a sequel “22 Jump Street”. Based on the similarity to these movies, and the arbitrariness of the name, I am deciding to rebrand the blog’s domain to avoid any confusion or unwanted connection. I have never seen the movies and have no idea what they are about. :) I was kind of bummed when I saw this and got less excited about writing here.

Read on →

Trivia, Social Connection, and Meta-Information

Attention conservation notice: development of the idea that trivia and current events have value as a way to connect with people, and connecting this with the Covey model of tasks.

I attempt to eschew trivia, to avoid learning things that have little value. By definition, trivia is trivial, so it is desirable to know as little of it as possible. Anything that I have knowledge of that is not useful represents an opportunity cost of foregone useful knowledge. Perhaps winning trivia night should be considered a mark of shame.

I don’t really keep up with the news all that much. Most things are outside of my locus of control. Does it really matter what celebrity did something, or that a tornado just hit a midwest town? Tornadoes will be hitting towns and celebrities will be doing things until the world ends. But knowing this fact allows me to mostly safely abstract away the news. Every now and then I don’t hear about something, but then people are able to fill me in on the details. Following news on a daily, or worse, hourly, basis is a recipe for wasting time and getting little value.

Read on →

Turning Away From Ruminations

There are some thoughts that are negative and self-reinforcing, and it is useful to catch these and stop thinking about them. A few years ago I shared my thoughts and techniques with someone else and they found it valuable, so I am going to share it here.

My personal example was playing conversations in my head about or with a certain person. I would imagine them saying something and what my responses would be. The conversations would typically be of an argumentative nature. Sometimes the thoughts would arise from me doing something and wondering what the other person would think. I think it was my brain’s defense mechanisms trying to prepare me for conflict.

Read on →