Freecodecamp: Use a Mixin Under Object Oriented Programming FCC Beta

Created on 3 Jul 2017  ·  5Comments  ·  Source: freeCodeCamp/freeCodeCamp

Challenge use-a-mixin-to-add-common-behavior-between-unrelated-objects has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

The condition to solve the challenge requires the mixin to be named "Mixing", but it was said that the name should be "Mixin". Just a typo in the assert probably.

let bird = {
name: "Donald",
numLegs: 2
};

let boat = {
name: "Warrior",
type: "race-boat"
};

// Add your code below this line
let glideMixing = function(obj){
obj.glide = function(){
return"I'm soaring!";
};
};

glideMixing(bird);
glideMixing(boat);

```

help wanted

All 5 comments

It works with glideMixin as well. The issue here is that the first test is not working correctly. It needs to be updated to check that a glideMixin function is defined. As it is, it passes without defining the function.

I see that now, thanks for the correction 👍

I'll take a look at this.

This comment was left in the Contributor chat room, but not in this issue: the problem is not with the test (the first test does check that a function named glideMixin exists) but that if you declared a glideMixin in a previous test run and then change the name to something different that should not pass the tests will still pass. It appears variables from old test runs are being leftover and influencing current test runs.

@QuincyLarson this issue appears to be fixed.

Was this page helpful?
0 / 5 - 0 ratings