From d08f009bd14cd1b9ce768584fc16033a65ef0f5e Mon Sep 17 00:00:00 2001
From: Ent Wickler <39570370+entwicklerfr@users.noreply.github.com>
Date: Mon, 23 Sep 2019 17:13:32 +0200
Subject: [PATCH] fix(curriculum): Add tests for setter, getter and setting a
temperature (es6 tests) (#36620)
* add testing for setter, getter and setting a temperature according to some of feedbacks into the issues 17403
* bugfix: temperature is not a function
---
...rs-and-setters-to-control-access-to-an-object.english.md | 6 ++++++
1 file changed, 6 insertions(+)
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 b480145038..f2e5b8344b 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
@@ -58,6 +58,12 @@ tests:
testString: assert(code.match(/class/g));
- text: Thermostat
should be able to be instantiated.
testString: assert((() => {const t = new Thermostat(32);return typeof t === 'object' && t.temperature === 0;})());
+ - text: A getter
should be defined.
+ testString: assert((() => {const desc = Object.getOwnPropertyDescriptor(Thermostat.prototype, 'temperature');return !!desc && typeof desc.get === 'function';})());
+ - text: A setter
should be defined.
+ testString: assert((() => {const desc = Object.getOwnPropertyDescriptor(Thermostat.prototype, 'temperature');return !!desc && typeof desc.set === 'function';})());
+ - text: Calling the setter
should set the temperature.
+ testString: assert((() => {const t = new Thermostat(32); t.temperature = 26;return t.temperature !== 0;})());
```