From a282c24bf4dd5cdc286876e4d7474f609e362839 Mon Sep 17 00:00:00 2001 From: Hassaan Pasha Date: Sun, 15 Mar 2020 09:55:21 +0500 Subject: [PATCH] fix (curriculum): added console output checks for the inheritance challenge (#38360) Co-authored-by: Hassaan Pasha --- .../add-methods-after-inheritance.english.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.english.md index bfb642ffbb..1d41bc5e6f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.english.md @@ -58,7 +58,14 @@ tests: testString: assert(beagle instanceof Animal); - text: The constructor for beagle should be set to Dog. testString: assert(beagle.constructor === Dog); - + - text: beagle.eat() should log "nom nom nom" + testString: | + console.log = function(msg){throw msg;} + assert.throws(() => beagle.eat(),"nom nom nom"); + - text: beagle.bark() should log "Woof!" + testString: | + console.log = function(msg){throw msg;} + assert.throws(() => beagle.bark(),"Woof!"); ```