From 7d7229c9503598066e166219d6fb8c168ee378e6 Mon Sep 17 00:00:00 2001 From: Louis TOUSSAINT Date: Tue, 13 Aug 2024 14:08:12 +0200 Subject: [PATCH] Tests(DPxAI): upload test for quest01 first-function --- js/tests/first-function.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 js/tests/first-function.json diff --git a/js/tests/first-function.json b/js/tests/first-function.json new file mode 100644 index 000000000..68d7ade4b --- /dev/null +++ b/js/tests/first-function.json @@ -0,0 +1,22 @@ +[ + { + "description": "ask is defined and is a function", + "code": "equal(typeof ask, 'function')" + }, + { + "description": "reply is defined and is a function", + "code": "equal(typeof reply, 'function')" + }, + { + "description": "ask works and is called", + "code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nequal(args[0], ['What is my purpose ?'])" + }, + { + "description": "reply works and is called too", + "code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nequal(args, [['What is my purpose ?'], ['You pass butter.']])" + }, + { + "description": "calling reply and ask again relog the text.", + "code": "const args = saveArguments(console, 'log')\n\n// Your code\n\nequal(args[1], ['You pass butter.'])" + } +] \ No newline at end of file