Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

View File

@ -0,0 +1,104 @@
'use strict';
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var childProcess = require('child_process');
describe('Testing CLI', function() {
it('should work for simple SVG', function(done) {
var command = 'node' +
' ' + path.join(__dirname, '..', 'bin', 'svgicons2svgfont.js') +
' -o ' + path.join(__dirname, 'results', 'originalicons-cli.svg') +
' -s 0xE001' +
' ' + path.join(__dirname, 'fixtures', 'originalicons', '*.svg');
(childProcess.exec)(
command,
function(err) {
if(err) {
throw err;
}
assert.equal(
fs.readFileSync(
path.join(__dirname, 'results', 'originalicons-cli.svg'),
{ encoding: 'utf8' }
),
fs.readFileSync(
path.join(__dirname, 'expected', 'originalicons-cli.svg'),
{ encoding: 'utf8' }
)
);
done();
}
);
});
it('should work for more than 32 SVG icons', function(done) {
var command = 'node' +
' ' + path.join(__dirname, '..', 'bin', 'svgicons2svgfont.js') +
' -o ' + path.join(__dirname, 'results', 'lotoficons-cli.svg') +
' -s 0xE001' +
' ' + path.join(__dirname, 'fixtures', 'cleanicons', '*.svg') +
' ' + path.join(__dirname, 'fixtures', 'hiddenpathesicons', '*.svg') +
' ' + path.join(__dirname, 'fixtures', 'multipathicons', 'kikoolol.svg') +
' ' + path.join(__dirname, 'fixtures', 'originalicons', '*.svg') +
' ' + path.join(__dirname, 'fixtures', 'realicons', '*.svg') +
' ' + path.join(__dirname, 'fixtures', 'roundedcorners', '*.svg') +
' ' + path.join(__dirname, 'fixtures', 'shapeicons', '*.svg') +
' ' + path.join(__dirname, 'fixtures', 'tocentericons', '*.svg');
(childProcess.exec)(
command,
function(err) {
if(err) {
throw err;
}
assert.equal(
fs.readFileSync(
path.join(__dirname, 'results', 'lotoficons-cli.svg'),
{ encoding: 'utf8' }
),
fs.readFileSync(
path.join(__dirname, 'expected', 'lotoficons-cli.svg'),
{ encoding: 'utf8' }
)
);
done();
}
);
});
describe('with nested icons', function() {
it('should work', function(done) {
var command = 'node' +
' ' + path.join(__dirname, '..', 'bin', 'svgicons2svgfont.js') +
' -o ' + path.join(__dirname, 'results', 'nestedicons-cli.svg') +
' ' + path.join(__dirname, 'fixtures', 'nestedicons', '*.svg');
(childProcess.exec)(
command,
function(err) {
if(err) {
throw err;
}
assert.equal(
fs.readFileSync(
path.join(__dirname, 'results', 'nestedicons-cli.svg'),
{ encoding: 'utf8' }
),
fs.readFileSync(
path.join(__dirname, 'expected', 'nestedicons-cli.svg'),
{ encoding: 'utf8' }
)
);
done();
}
);
});
});
});