Skip to content

v1.1.0 empty process.argv on execution #13

@talon

Description

@talon

While working on updating the levelmeup nodeschool to the latest workshopper I ran into an error where workshopper-exercise v1.1.0 doesn't pass arguments when you run the solution. v0.2.3 works though.

the error with v1.1.0

levelmeup run solutions/solution.js
ALL YOUR undefined ARE BELONG TO undefined.

The code that is run.

 var exercise      = require('workshopper-exercise')()
  , filecheck     = require('workshopper-exercise/filecheck')
  , execute       = require('workshopper-exercise/execute')
  , comparestdout = require('workshopper-exercise/comparestdout')


// checks that the submission file actually exists
exercise = filecheck(exercise)

// execute the solution and submission in parallel with spawn()
exercise = execute(exercise)

// compare stdout of solution and submission
exercise = comparestdout(exercise)

exercise.addSetup(function (mode, callback) {

  // array for substitution in: 'ALL YOUR X ARE BELONG TO Y'
  const inputs = [
      [ 'BASE', 'US' ]
    , [ 'LANDS AND POSESSIONS', 'VIKINGS OF WESTERN NORWAY' ]
    , [ 'INDEPENDENCE', 'KING HENRY VIII' ]
    , [ 'INTERNET COMMUNICATIONS', 'THE NSA' ]
    , [ 'TICKS', 'LIBUV' ]
  ]

  var i = Math.floor(Math.random() * inputs.length)
  this.submissionArgs = this.solutionArgs = inputs[i]

  process.nextTick(callback)
})

module.exports = exercise

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions