Fullstack path project Lodash invert() method has extra test?

Hello,

I’m working on the Fullstack path project for Javascript Syntax part II, Lodash. I’ve hit step 23, “implement invert()” and there seems to be an extra test in the test/invert.js that doesn’t show up in the walkthrough video.

I’ve gone through the project with the walkthrough and created the method as she does it, and it fails the final test. I’ve noticed that the walkthrough video doesn’t have this final code test - screenshots here:

note, only three tests.

invert(object){
    let invertedObject = {};
    for (let key in object){
      const originalValue = object[key];
      invertedObject = {originalValue:key}
    }
    return invertedObject;
  }

returns

1 - _.invert() is defined - Passed!
2 - Returns an object with key and value inverted for a single key-value pair - Passed!
3 - Original key is not present after the key-value pairs have been inverted - Passed!
4 - Returns an object with all keys and values inverted - Failed: _.invert({originalKey: "originalValue"})["originalKey"]) returned undefined instead of anotherKey.

I can manually go into the test/invert.js file and remove that test, but I don’t think that’s really what is being asked of me!

Please advise what to do in this case.

Cheers,

coffeesp00ns

Hi everyone,

I just checked the comments underneath the youtube video and user Fjodor Jevsejev had this code that solves the code and passes the tests.

invert(object) {
      let invertedObject = {};

      for(let key in object) {
        const originalValue = object[key];
        invertedObject[originalValue] = key;
      }
      return invertedObject;
  },

From the comments, it sounds like there are a few issues with the code in this walkthrough, though this was the only one that I found and needed a solution for.

I’m going to keep the notifications for this on, but this looks like it’s been a lingering issue codecademy needs to fix.

cheers,

'spoons