How could I fail this test?

Tell us what’s happening:
On the challenge “Object Oriented Programming: Add Methods After Inheritance,” one of the tests says "Animal should not respond to the bark() method.

I know how to pass the challenge correctly, but I don’t understand it well enough to know what would make this test fail. How could I write the code wrongly so that it would have this error and why would it work out that way?

As a side-note/bonus question, why does the console.log(Object.keys(beagle)) print an empty array here?

Your code so far


function Animal() { }
Animal.prototype.eat = function() { console.log("nom nom nom"); };

function Dog() { }

// Only change code below this line
Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;
Dog.prototype.bark = function() {
  console.log("Woof!")
}
// Only change code above this line

let beagle = new Dog();

console.log(Object.keys(beagle))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36.

Challenge: Add Methods After Inheritance

Link to the challenge:

My JS knowledge is limited since I myself went through Object Oriented programming a few weeks ago. As far as I know your code is perfectly fine and it works if I try it.

I know it works, but I was wondering what I could do to make it not work in a specific way.

Oh I got your quetion wrong. From" Animal should not respond to the bark() method." I dont know what it exactly means to say. But what I get at first glance is that its saying that no “animal” meaning any array who has inherited animal as its prototype should not have it.

Animal.prototype.bark = function() {
  console.log("Woof!")
}

There you go doing this shows this error.
Though Im not very sure as it also has another test specifically depicting that it should be an “own” property.