Skip to content

Commit

Permalink
Add test for specific config set for prefixIds with multipass.
Browse files Browse the repository at this point in the history
  • Loading branch information
strarsis committed Mar 9, 2020
1 parent 4e20568 commit 280aed9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/coa/_index.js
Expand Up @@ -217,6 +217,22 @@ describe('coa', function() {
}, error => done(error));
});

it('should work correctly with some specific options', function(done) {
svgo({
input: mpSvgInPath,
output: 'temp.svg',
quiet: true,
multipass: true,
config: '{ "plugins": [ { "prefixIds": { "delim": "_" } }, { "cleanupIDs": { "minify": true } } ] }',
}).then(function() {
const mpSvgOut = fs.readFileSync('temp.svg', 'utf8');

done(/in_svg_/.test(mpSvgOut) ? null : 'prefixIds plugin doesn\'t work correctly with some specific options.');

fse.removeSync('temp.svg');
}, error => done(error));
});

it('should allow addAttributesToSVGElement plugin to correctly handle subsequent passes with multipass enabled', function(done) {
svgo({
input: mpSvgInPath,
Expand Down

0 comments on commit 280aed9

Please sign in to comment.