diff --git a/common/app/routes/challenges/utils.js b/common/app/routes/challenges/utils.js index 414ea6b6ebc..1743c52d08a 100644 --- a/common/app/routes/challenges/utils.js +++ b/common/app/routes/challenges/utils.js @@ -35,10 +35,15 @@ export function getFileKey({ challengeType }) { export function createTests({ tests = [] }) { return tests - .map(test => ({ - text: ('' + test).split('message: ').pop().replace(/\'\);/g, ''), - testString: test - })); + .map(test => { + if (typeof tests === 'string') { + return { + text: ('' + test).split('message: ').pop().replace(/\'\);/g, ''), + testString: test + }; + } + return test; + }); } export function loggerToStr(args) { diff --git a/seed/challenges/01-front-end-development-certification/html5-and-css.json b/seed/challenges/01-front-end-development-certification/html5-and-css.json index 6aae2a2238a..bbb5b9f7c02 100644 --- a/seed/challenges/01-front-end-development-certification/html5-and-css.json +++ b/seed/challenges/01-front-end-development-certification/html5-and-css.json @@ -24,7 +24,10 @@ "
h1 element should have the text \"Hello World\".');"
+ {
+ "text": "Your h1 element should have the text \"Hello World\".');",
+ "testString": "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\".');"
+ }
],
"type": "waypoint",
"challengeType": 0,