Skip to content

Commit

Permalink
Merge pull request #225 from rvagg/cleanup-guards
Browse files Browse the repository at this point in the history
guards for no `this.*` properties in cleanup
  • Loading branch information
rvagg committed Feb 18, 2015
2 parents 89deb38 + 351b011 commit fe1c2b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exercises/http_client/exercise.js
Expand Up @@ -49,6 +49,9 @@ exercise.addSetup(function (mode, callback) {
exercise.addCleanup(function (mode, passed, callback) {
// mode == 'run' || 'verify'

if (!this.server)
return process.nextTick(callback)

this.server.close(callback)
})

Expand Down
3 changes: 3 additions & 0 deletions exercises/juggling_async/exercise.js
Expand Up @@ -82,6 +82,9 @@ exercise.addSetup(function (mode, callback) {
exercise.addCleanup(function (mode, passed, callback) {
// mode == 'run' || 'verify'

if (!this.servers)
return process.nextTick(callback)

// close all 3 servers
var done = after(3, callback)
this.servers.forEach(function (s) {
Expand Down

0 comments on commit fe1c2b0

Please sign in to comment.