2015-11-04 12:37:25 -08:00
|
|
|
/* eslint-disable no-undef, no-unused-vars, no-native-reassign */
|
2015-11-13 11:10:23 -08:00
|
|
|
window.$ = parent.$;
|
|
|
|
window.$(function() {
|
|
|
|
var _ = parent._;
|
|
|
|
var chai = parent.chai;
|
2015-05-28 08:26:25 -04:00
|
|
|
var expect = chai.expect;
|
|
|
|
var tests = parent.tests;
|
2015-11-13 11:10:23 -08:00
|
|
|
var common = parent.common;
|
|
|
|
var editorValue = common.editor.getValue();
|
2015-05-28 08:26:25 -04:00
|
|
|
|
2015-11-13 11:10:23 -08:00
|
|
|
common.tests.forEach(test => {
|
|
|
|
try {
|
|
|
|
/* eslint-disable no-eval */
|
|
|
|
eval(test);
|
|
|
|
/* eslint-enable no-eval */
|
|
|
|
} catch (e) {
|
|
|
|
parent.postError(JSON.stringify(e.message.split(':').shift()));
|
|
|
|
} finally {
|
|
|
|
parent.postSuccess(
|
|
|
|
JSON.stringify(
|
|
|
|
test.split(',').pop().replace(/\'/g, '').replace(/\)/, '')
|
|
|
|
)
|
|
|
|
);
|
2015-05-28 08:26:25 -04:00
|
|
|
}
|
2015-11-13 11:10:23 -08:00
|
|
|
});
|
|
|
|
});
|