Ad
  • Default User Avatar

    JS: No sample tests

  • Custom User Avatar

    The fixed tests are weak and allow wrong solutions to pass.

  • Custom User Avatar

    No random tests.

  • Custom User Avatar

    suggested test cases:

    describe("set value", function(){
      let stuff = {};
      it ("set value", function(){
          namespace(stuff, 'moreStuff.name', 'the stuff');
          Test.assertSimilar(stuff, {moreStuff: {name: 'the stuff'}});
      });
    });
    
    describe("get value", function(){
      let stuff = {moreStuff: {name: 'the stuff'}};
      it ("valid path", function(){
          Test.assertEquals(namespace(stuff, 'moreStuff.name'), 'the stuff');
      });
      
      it ("invalid path", function(){
          Test.assertEquals(namespace(stuff, 'otherStuff.id'), undefined);
      });
    });
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Does not test if function supports getting the value at all
    Does not test if prototype methods/properties are ignored

  • Custom User Avatar

    The last example in the 'descritpion' has a typo...

    namesace(stuff, 'otherStuff.id') # returns undefined