var common = window.common || { init: [] };
var BDDregex = new RegExp(
'(expect(\\s+)?\\(.*\\;)|' +
'(assert(\\s+)?\\(.*\\;)|' +
'(assert\\.\\w.*\\;)|' +
'(.*\\.should\\..*\\;)/'
);
var libraryIncludes =
"" +
"" +
"" +
'';
var iFrameScript = "";
function workerError(error) {
var display = $('.runTimeError');
var housing = $('#testSuite');
if (display.html() === error) {
return null;
}
display.remove();
housing.prepend(`
${common.unScopeJQuery(error)}
`);
display.hide().fadeIn(function() {
setTimeout(function() {
display.fadeOut(function() {
display.remove();
});
}, 1000);
});
}
common.safeHTMLRun = function safeHTMLRun(shouldTest) {
const codeStorage = common.codeStorage;
if (common.challengeType !== '0') {
return null;
}
const editorValue = common.editor.getValue();
const previewFrame = document.getElementById('preview');
const preview = previewFrame.contentDocument ||
previewFrame.contentWindow.document;
if (!editorValue.match(/\