Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
Fixes #37
Closes #38
  • Loading branch information
sindresorhus committed Feb 19, 2020
1 parent 1e0bac3 commit 71a27ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "SVGO imagemin plugin",
"license": "MIT",
"repository": "imagemin/imagemin-svgo",
"funding": "https://github.com/sindresorhus/imagemin-svgo?sponsor=1",
"engines": {
"node": ">=6"
},
Expand All @@ -17,18 +18,17 @@
"compress",
"image",
"imageminplugin",
"img",
"minify",
"optimize",
"svg",
"svgo"
],
"dependencies": {
"is-svg": "^3.0.0",
"svgo": "^1.0.5"
"is-svg": "^4.2.1",
"svgo": "^1.3.2"
},
"devDependencies": {
"ava": "*",
"xo": "*"
"ava": "^1.0.0",
"xo": "^0.20.0"
}
}
14 changes: 8 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* eslint-disable ava/use-t-well */
import test from 'ava';
import m from '.';
import imageminSvgo from '.';

test('optimize a SVG', async t => {
t.is((await m()('<svg><style> circle {} </style></svg>')).toString(), '<svg><style/></svg>');
t.is((await imageminSvgo()('<svg><style> circle {} </style></svg>')).toString(), '<svg><style/></svg>');
});

test('support SVGO options', async t => {
const data = (await m({
const data = (await imageminSvgo({
plugins: [{
removeStyleElement: true
}]
Expand All @@ -15,10 +16,11 @@ test('support SVGO options', async t => {
t.is(data, '<svg/>');
});

test('error on corrupt SVG', async t => {
await t.throws(m()('<svg>style><</style></svg>'), /Error in parsing SVG/);
// Failing as SVGO doesn't throw proper errors...
test.failing('error on corrupt SVG', async t => {
await t.throwsAsync(imageminSvgo()('<svg>style><</style></svg>'), {message: /Error in parsing SVG/});
});

test('ignore non valid SVG', async t => {
t.is(await m()('<html></html>'), '<html></html>');
t.is(await imageminSvgo()('<html></html>'), '<html></html>');
});

0 comments on commit 71a27ac

Please sign in to comment.