Files
SCEditor/tests/unit/init.js
Sam 437e5881b2 Update dev dependencies (#801)
* Update dev dependencies
This removes sauce support and githhoks support.

Switches from postcss-clean to to cssnano

* Fix coverage

* Update autoprefixer to latest version
2021-02-23 19:23:35 -07:00

66 lines
1.4 KiB
JavaScript

(function () {
// Report QUnit results to SauceLabs
var log = [];
QUnit.done(function (testResults) {
var tests = [];
for (var i = 0, len = log.length; i < len; i++) {
var details = log[i];
tests.push({
name: details.name,
result: details.result,
expected: details.expected,
actual: details.actual,
source: details.source
});
}
testResults.tests = tests;
// Send istanbul coverage to grunt
if (window.__grunt_contrib_qunit__) {
window.__grunt_contrib_qunit__('qunit.coverage', window.__coverage__);
}
});
QUnit.testStart(function (testDetails) {
QUnit.log = function (details) {
if (!details.result) {
details.name = testDetails.name;
log.push(details);
}
};
});
// Add moduleSetup and moduleTeardown properties to the
// modules settings and add support for a module fixture
// div#qunit-module-fixture
var oldModule = QUnit.module;
QUnit.module = function (name, settings) {
settings = settings || {};
if (settings.moduleSetup) {
QUnit.moduleStart(function (details) {
$('#qunit-module-fixture').empty();
if (details.name === name) {
settings.moduleSetup();
}
});
}
if (settings.moduleTeardown) {
QUnit.moduleDone(function (details) {
if (details.name === name) {
settings.moduleTeardown();
}
$('#qunit-module-fixture').empty();
});
}
oldModule(name, settings);
};
}());