From 941c0201fadc75f2fcfa9a60b49e4c5c9a5897df Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Thu, 2 Feb 2017 12:34:25 +0100 Subject: [PATCH] fix(challenge): stricter tests for "Add Items Using splice()". --- .../basic-data-structures.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-data-structures.json b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-data-structures.json index ac59ef8ab6..3459221dd8 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-data-structures.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-data-structures.json @@ -227,7 +227,9 @@ ], "tests": [ "assert.deepEqual(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurqoise', 'FireBrick']), ['DarkSalmon', 'BlanchedAlmond', 'LavenderBlush', 'PaleTurqoise', 'FireBrick'], 'message: htmlColorNames should return [\"DarkSalmon\", \"BlanchedAlmond\", \"LavenderBlush\", \"PaleTurqoise\", \"FireBrick\"]');", - "assert.notStrictEqual(htmlColorNames.toString().search(/\\.splice\\(/), -1, 'message: The htmlColorNames function should utilize the splice() method');" + "assert(/.splice/.test(code), 'message: The htmlColorNames function should utilize the splice() method');", + "assert(!/shift|unshift/.test(code), 'message: You should not use shift() or unshift().');", + "assert(!/\\[\\d\\]\\s*=/.test(code), 'message: You should not use array bracket notation.');" ], "type": "waypoint", "solutions": [],