From df995dbdcbeb0272005cadb89f05800084610f9d Mon Sep 17 00:00:00 2001 From: Louis TOUSSAINT Date: Wed, 31 Jul 2024 15:51:22 +0200 Subject: [PATCH] Tests(DPxAI): Add test for Quest01 play-with-variables --- js/tests/play-with-variables_test.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 js/tests/play-with-variables_test.json diff --git a/js/tests/play-with-variables_test.json b/js/tests/play-with-variables_test.json new file mode 100644 index 000000000..b2fb42b22 --- /dev/null +++ b/js/tests/play-with-variables_test.json @@ -0,0 +1,22 @@ +[ + { + "description": "escapeFromDelimiters is declared and includes a double-quote", + "code": "if (typeof escapeFromDelimiters === 'undefined') {\n throw Error(\n `You didn't even define the variable... we've been through this already !`,\n )\n}\n\nif (!escapeFromDelimiters.includes('\"')) {\n throw Error('escapeFromDelimiters must include a double-quote\"')\n}" + }, + { + "description": "escapeFromDelimiters includes a single-quote", + "code": "if (!escapeFromDelimiters.includes(\"'\")) {\n throw Error(\"escapeFromDelimiters must include a single-quote'\")\n}" + }, + { + "description": "escapeFromDelimiters includes a backtick", + "code": "if (!escapeFromDelimiters.includes('`')) {\n throw Error('escapeFromDelimiters must include a backtick `')\n}" + }, + { + "description": "escapeTheEscape includes a backslash", + "code": "if (!new TextEncoder().encode(escapeTheEscape).includes(92)) {\n throw Error('escapeTheEscape must includes a backslash')\n}" + }, + { + "description": "The value of power must have changed", + "code": "let power = 'under 9000'\n\n// Your code\n\nequal(love, 'levelMax')" + } +]