Challenge use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
The following passes. Code doesn't have bugs, but also doesn't properly follow the instructions.
const stats = {
max: 56.78,
standard_deviation: 4.34,
median: 34.54,
mode: 23.87,
min: -0.75,
average: 35.85
};
/* Alter code below this line */
const {max, min} = stats
const half = (max, min) => (max + min) / 2.0; // use function argument destructurung
/* Alter code above this line */
console.log(stats); // should be object
console.log(half(stats)); // should be 28.015
@forkerino Yeah, true. half(stats)
returns NaN
This shows some beta tests are yet to be written. Maybe, i can help write this one and few others :sweat_smile:
True, these lines for the tests have yet to be written. @ooade if you wanna help out with writing them, go for it! 馃憤
Okay, i'm taking it on @erictleung :+1:
@systimotic Anything on the es6 challenges... I was thinking... Since the code gets transpiled to es5, we could also test the es5 syntax. For example (This present challenge solution) transpiles:
const half = ({ min, max }) => ((min + max) / 2.0);
to
var half = function half(_ref) {
var min = _ref.min,
max = _ref.max;
return (min + max) / 2.0;
};
Tested it locally and on babeljs.io
Therefore if the reference(_ref
) is not found, then the user didn't use the destructuring assignment and so on... Testing continues...
@ooade Interesting approach!! That may work, though I think it could be more prone to breaking if the transpiler changes. The spec won't change, but the transpiler might. Preferably, we'd fix this at the root cause and get access to the actual written code in the tests.
@systimotic Cool! I'll be happy to help anytime it's ready.
@systimotic - do we know if anyone is working on writing tests for these? It looks like the entire ES6 section needs either formatting or test cases to be written. At least 16 of the challenges have zero or only partial tests written. The others are not in the correct test case format.
We may be limited on how we test _some_ of these, but most can be tested using deep equality methods and regex. EDIT: I was wrong about this, we still cannot test these challenges.
@QuincyLarson - I know you mentioned you felt we were pretty close to shipping beta once Berkeley finished up with some of the major architectural changes - were you aware that there are still entire sections like this that have challenges that have not yet been completed? After our call today, and looking through the beta curriculum, I think there is quite a bit left to do with the existing material, making me wonder if now is the best time to introduce anything else significant to a curriculum that we are already struggling to keep up with QAing and preparing for shipping to prod.
@no-stack-dub-sack I'm confident we'll be able to fill in these tests pretty quickly once @Berkeleytrue ships his layout fixes and we can run D3, React, ES6, and other tools on beta. Until that point, it's hard to create and test new tests.
Hi everyone! This hasn't been fixed yet, but we're tracking this in #12698 now. I'm closing this in favor of that.
Happy coding!