From eeaac5544376c112a9194d5e65510c433b0928d9 Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Sat, 4 Feb 2017 19:36:04 +0100 Subject: [PATCH] fix(challenge): Stricter tests for "OOP: New Object Prototype". --- .../object-oriented-programming.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json b/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json index 1b48605dce7..0e76ff0e819 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json @@ -446,7 +446,7 @@ "A more efficient way is to set the prototype to a new object that already contains the properties. This way, the properties are added all at once:", "
Bird.prototype = {
  numLegs: 2,
  eat: function() {
    console.log(\"nom nom nom\");
  },
  describe: function() {
    console.log(\"My name is \" + this.name);
  }
};
", "
", - "Add three properties numLegs, eat, and describe to the prototype of Dog by setting the prototype to a new object. The properties can be set to any values." + "Add the property numLegs and the two methods eat() and describe() to the prototype of Dog by setting the prototype to a new object." ], "challengeSeed": [ "function Dog(name) {", @@ -461,8 +461,8 @@ "tests": [ "assert((/Dog\\.prototype\\s*?=\\s*?{/).test(code), 'message: Dog.prototype should be set to a new object.');", "assert(Dog.prototype.numLegs !== undefined, 'message: Dog.prototype should have the property numLegs.');", - "assert(Dog.prototype.eat !== undefined, 'message: Dog.prototype should have the property eat.'); ", - "assert(Dog.prototype.describe !== undefined, 'message: Dog.prototype should have the property describe.'); " + "assert(typeof Dog.prototype.eat === 'function', 'message: Dog.prototype should have the method eat().'); ", + "assert(typeof Dog.prototype.describe === 'function', 'message: Dog.prototype should have the method describe().'); " ], "solutions": [], "hints": [],