From 5eed37c6cabc7ef9cdf5baa4e8b7f134d97d1347 Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Fri, 24 Feb 2017 22:07:28 -0500 Subject: [PATCH] Modified test to test for function not regex match --- challenges/04-data-visualization/json-apis-and-ajax.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/04-data-visualization/json-apis-and-ajax.json b/challenges/04-data-visualization/json-apis-and-ajax.json index 91a3c16253..0461c69773 100644 --- a/challenges/04-data-visualization/json-apis-and-ajax.json +++ b/challenges/04-data-visualization/json-apis-and-ajax.json @@ -88,7 +88,7 @@ ], "tests": [ "assert(code.match(/document\\.getElementById\\(\\s*?('|\")getMessage\\1\\s*?\\)/g), 'message: Your code should use the document.getElementById method to select the getMessage element.');", - "assert(code.match(/\\.onclick=function\\(\\s*?\\)\\s*?{\\s*?};/g), 'message: Your code should add an onclick event handler.');" + "assert(typeof document.getElementById('getMessage').onclick === 'function', 'message: Your code should add an onclick event handler.');" ], "solutions": [], "hints": [], @@ -691,4 +691,4 @@ "translations": {} } ] -} \ No newline at end of file +}