Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/inventory.picotech.app/public_html/node_modules/node-sass/scripts/ drwxr-xr-x | |
| Viewing file: Select action/file-type: /*!
* node-sass: scripts/coverage.js
*/
var Mocha = require('mocha'),
fs = require('fs'),
path = require('path'),
mkdirp = require('mkdirp'),
coveralls = require('coveralls'),
istanbul = require('istanbul'),
sourcefiles = ['index.js', 'binding.js', 'extensions.js', 'render.js', 'errors.js'],
summary= istanbul.Report.create('text-summary'),
lcov = istanbul.Report.create('lcovonly', { dir: path.join('coverage') }),
html = istanbul.Report.create('html', { dir: path.join('coverage', 'html') });
function coverage() {
var mocha = new Mocha();
var rep = function(runner) {
runner.on('end', function(){
var cov = global.__coverage__,
collector = new istanbul.Collector();
if (cov) {
mkdirp(path.join('coverage', 'html'), function(err) {
if (err) { throw err; }
collector.add(cov);
summary.writeReport(collector, true);
html.writeReport(collector, true);
lcov.on('done', function() {
fs.readFile(path.join('coverage', 'lcov.info'), function(err, data) {
if (err) { console.error(err); }
coveralls.handleInput(data.toString(),
function (err) { if (err) { console.error(err); } });
});
});
lcov.writeReport(collector, true);
});
} else {
console.warn('No coverage');
}
});
};
var instrumenter = new istanbul.Instrumenter();
var instrumentedfiles = [];
var processfile = function(source) {
fs.readFile(path.join('lib', source), function(err, data) {
if (err) { throw err; }
mkdirp('lib-cov', function(err) {
if (err) { throw err; }
fs.writeFile(path.join('lib-cov', source),
instrumenter.instrumentSync(data.toString(),
path.join('lib', source)),
function(err) {
if (err) { throw err; }
instrumentedfiles.push(source);
if (instrumentedfiles.length === sourcefiles.length) {
fs.readdirSync('test').filter(function(file){
return file.substr(-6) === 'api.js' ||
file.substr(-11) === 'runtime.js' ||
file.substr(-7) === 'spec.js';
}).forEach(function(file){
mocha.addFile(
path.join('test', file)
);
});
process.env.NODESASS_COV = 1;
mocha.reporter(rep).run(function(failures) {
process.on('exit', function () {
process.exit(failures);
});
});
}
});
});
});
};
for (var i in sourcefiles) {
processfile(sourcefiles[i]);
}
}
/**
* Run
*/
coverage();
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0035 ]-- |