Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1.0 empty process.argv on execution #13

Open
talon opened this issue Dec 16, 2014 · 0 comments
Open

v1.1.0 empty process.argv on execution #13

talon opened this issue Dec 16, 2014 · 0 comments

Comments

@talon
Copy link

talon commented Dec 16, 2014

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant