From 739f4a8850998a885671bb68bdf76a090d057ff1 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 21 Mar 2019 02:50:30 -0700 Subject: [PATCH] fix: Update test for ES6 challenge (#34300) * fix: es6 challenge test * delete console.log --- ...ers-to-control-access-to-an-object.english.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md index 45fdd88cd3..b739dc25dc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md @@ -38,7 +38,7 @@ tests: - text: class keyword was used. testString: getUserInput => assert(getUserInput('index').match(/class/g),'class keyword was used.'); - text: Thermostat can be instantiated. - testString: assert(() => {const t = new Thermostat(32); return typeof t === 'object' && t.temperature === 0;}, 'Thermostat can be instantiated.'); + testString: assert((() => {const t = new Thermostat(32);return typeof t === 'object' && t.temperature === 0;})(), 'Thermostat can be instantiated.'); ``` @@ -75,17 +75,17 @@ temp = thermos.temperature; // 26 in C ```js function makeClass() { - "use strict"; + 'use strict'; /* Alter code below this line */ class Thermostat { - constructor(fahrenheit) { - this._tempInCelsius = 5/9 * (fahrenheit - 32); + constructor(temperature) { + this._temperature = (5 / 9) * (temperature - 32); } - get tempInCelsius(){ - return _tempInCelsius; + get temperature() { + return this._temperature; } - set tempInCelsius(newTemp){ - this._tempInCelsius = newTemp; + set temperature(temperature) { + this._temperature = temperature; } } /* Alter code above this line */