'use strict'; const { optimize } = require('./svgo.js'); test('allow to setup default preset', () => { const svg = ` Not standard description `; expect( optimize(svg, { plugins: ['preset-default'], js2svg: { pretty: true, indent: 2 }, }).data ).toMatchInlineSnapshot(` " " `); }); test('allow to disable and customize plugins in preset', () => { const svg = ` Not standard description `; expect( optimize(svg, { plugins: [ { name: 'preset-default', params: { overrides: { removeXMLProcInst: false, removeDesc: { removeAny: false, }, }, }, }, ], js2svg: { pretty: true, indent: 2 }, }).data ).toMatchInlineSnapshot(` " Not standard description " `); }); test('allow to customize precision for preset', () => { const svg = ` `; expect( optimize(svg, { plugins: [ { name: 'preset-default', params: { floatPrecision: 4, }, }, ], js2svg: { pretty: true, indent: 2 }, }).data ).toMatchInlineSnapshot(` " " `); }); test('plugin precision should override preset precision', () => { const svg = ` `; expect( optimize(svg, { plugins: [ { name: 'preset-default', params: { floatPrecision: 4, overrides: { cleanupNumericValues: { floatPrecision: 5, }, }, }, }, ], js2svg: { pretty: true, indent: 2 }, }).data ).toMatchInlineSnapshot(` " " `); });