forked from enviPath/enviPy
Current Dev State
This commit is contained in:
104
static/js/ketcher2/node_modules/svgicons2svgfont/tests/cli.mocha.js
generated
vendored
Normal file
104
static/js/ketcher2/node_modules/svgicons2svgfont/tests/cli.mocha.js
generated
vendored
Normal 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();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user