2015-11-04 20:37:25 +00:00
|
|
|
/* eslint-disable no-undef, no-unused-vars, no-native-reassign */
|
2015-05-28 12:26:25 +00:00
|
|
|
(function() {
|
|
|
|
var expect = chai.expect;
|
|
|
|
var tests = parent.tests;
|
|
|
|
var editor = parent.editorValueForIFrame;
|
|
|
|
|
2015-06-07 03:58:27 +00:00
|
|
|
setTimeout(function() {
|
|
|
|
for (var i = 0; i < tests.length; i++) {
|
|
|
|
var thisTest = true;
|
|
|
|
try {
|
2015-11-04 20:37:25 +00:00
|
|
|
/* eslint-disable no-eval */
|
2015-06-07 03:58:27 +00:00
|
|
|
eval(parent.tests[i]);
|
2015-11-04 20:37:25 +00:00
|
|
|
/* eslint-enable no-eval */
|
2015-06-07 03:58:27 +00:00
|
|
|
} catch (err) {
|
|
|
|
allTestsGood = false;
|
|
|
|
thisTest = false;
|
|
|
|
parent.postError(JSON.stringify(err.message.split(':').shift()));
|
|
|
|
} finally {
|
|
|
|
if (thisTest) {
|
|
|
|
parent.postSuccess(JSON.stringify(tests[i].split(',').pop().replace(
|
|
|
|
/\'/g, '').replace(/\)/, '')));
|
|
|
|
}
|
2015-05-28 12:26:25 +00:00
|
|
|
}
|
|
|
|
}
|
2015-06-08 01:29:00 +00:00
|
|
|
}, 10);
|
2015-05-28 12:26:25 +00:00
|
|
|
})();
|