Comments (7)
Yes, this exercise purposefully compares stdout of both your script and one executing the expected way. Closing as this is by design. (If you have a better way of doing this, I am all ears :])
from learnyoumongo.
Same issue:
OSX 10.11.1, Node v0.12.7, Mongo v3.2.4, Learnyoumongo v3.0.1
from learnyoumongo.
Exercise 6 works, which makes me think that this is a bug, but E5 does use console.log for checking answers, so this might be by design. I'll have a look in the code and report back.
Part 2:
This line might be what's doing it, I'll check on an offline copy.
EDIT: Not by itself. I don't understand Workshopper to do anything more than guess at what does what, so I don't think I can do any more here.
Part 3:
I'm trying out some alternatives to console log:
- console.warn() - no luck
- console.error() - nope
- console.dir() - nothing
Part 4:
It's not a platform-specific thing, it fails on Ubuntu 14.04.4 with Node v4.4.0, Mongo v2.4.9, and learnyoumongo v3.0.1
Part 5 (24/3/2016 NZDT):
I've tried commenting out all instances of "stdout" in insert/exercise.js. No luck. A quick check of the diff between this exercise and the one before shows nothing that would be blocking console.log.
from learnyoumongo.
Same issue here on OSX 10.11.1
from learnyoumongo.
I seem to have found something. The line:
exercise = comparestdout(exercise)
is missing from Exercise 5. It's just after the line:
exercise = execute(exercise)
in exercise 4. Once I add it, I get messages to the console....
from learnyoumongo.
Update: So the above does allow me to see my console.log outputs, but it breaks the verify processor. Seems this exercise implements it's own processor as follows, which breaks Stdout somehow. I still can't figure out where yet:
exercise.addProcessor(function(mode, cb) {
var orig
this.submissionStdout.pipe(sub)
var args = this.solutionArgs
sub.on('data', function(chunk) {
chunk = chunk.toString()
if (chunk)
try {
orig = JSON.parse(chunk)
delete orig._id
}
catch (err) {
exercise.emit('fail', 'Unable to parse JSON. ' +
'Did you stringify the output?')
cb(err)
}
})
if (mode === 'verify') {
sub.on('end', function() {
if (orig) {
findDoc(args, function(err, doc) {
if (err) return cb(err)
orig = sortObj(orig)
doc = sortObj(doc)
try {
compare(orig, doc)
cb(null, true)
}
catch (e) {
console.log(e)
exercise.emit('fail', e.message)
cb(null, false)
}
//sub.end()
})
} else {
cb(null, false)
}
})
}
this.submissionStdout = through2()
if (mode === 'verify')
this.solutionStdout = through2()
if (mode === 'run') {
sub.pipe(process.stdout)
process.nextTick(function() {
cb(null, true)
})
}
})
from learnyoumongo.
Having the same issue here, can't also get to work this problem here in my end.
from learnyoumongo.
Related Issues (20)
- Aggregate exercise - why use toArray ? HOT 1
- Ex5: Insert. / Keep getting "AssertionError" HOT 6
- Change documentation resources? HOT 1
- Call for maintainers HOT 4
- Only localhost? HOT 3
- Can't get past the first hurdle HOT 2
- 123
- Irrelevant messages in the instructions of the first two challenges HOT 1
- 2/6 CONNECT instruction not working on Cloud9 HOT 3
- ReferenceError: done is not defined HOT 2
- remove doesn't work HOT 3
- The aggregate exercise question has mark down that doesn't display well on the terminal
- Insert module needs an additional hint HOT 2
- Official solutions should be updated to MongoDB ^3.0.0 HOT 2
- Solutions updated to MongoDB +3.0.0!
- Error in description of exercises
- Find Project exercise: incorrect example and resource link
- Find exercise: connect callback parameters have changed in current version HOT 8
- Why is my solution to UPDATE not being verified and console.log is not working HOT 1
- Still being maintained? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learnyoumongo.