Browse Source

Tests(DPxAI): Update test for Quest01 play-with-variables

pull/2706/head
Louis TOUSSAINT 3 months ago committed by Oumaima Fisaoui
parent
commit
a7b2fc47ad
  1. 8
      js/tests/play-with-variables.json

8
js/tests/play-with-variables.json

@ -1,19 +1,19 @@
[
{
"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}"
"code": "let power = 'under 9000'\n\n// Your code\nif (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}"
"code": "let power = 'under 9000'\n\n// Your code\nif (!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}"
"code": "let power = 'under 9000'\n\n// Your code\nif (!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}"
"code": "let power = 'under 9000'\n\n// Your code\nif (!new TextEncoder().encode(escapeTheEscape).includes(92)) {\n throw Error('escapeTheEscape must includes a backslash')\n}"
},
{
"description": "The value of power must have changed",

Loading…
Cancel
Save