-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
16 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`optimizes SVG correctly 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><line x1=\\"23\\" y1=\\"1\\" x2=\\"1\\" y2=\\"23\\"/><line x1=\\"1\\" y1=\\"1\\" x2=\\"23\\" y2=\\"23\\"/></svg>"`; | ||
exports[`rejects when passed unparsable SVG string 1`] = ` | ||
[Error: Error in parsing SVG: Unclosed root tag | ||
Line: 0 | ||
Column: 10 | ||
Char: ] | ||
`; |
This file was deleted.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
bin/__tests__/process-svg.test.js → bin/__tests__/optimize-svg.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
/* eslint-env jest */ | ||
import processSvg from '../process-svg'; | ||
import optimizeSvg from '../optimize-svg'; | ||
|
||
test('processes SVG correctly', () => { | ||
test('optimizes SVG correctly', () => { | ||
const SVG = | ||
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><title>Title</title><line x1="23" y1="1" x2="1" y2="23" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/><line x1="1" y1="1" x2="23" y2="23" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/></svg>'; | ||
|
||
expect(processSvg(SVG)).resolves.toMatchSnapshot(); | ||
expect(optimizeSvg(SVG)).resolves.toMatchSnapshot(); | ||
}); | ||
|
||
test('rejects when passed unparsable SVG string', () => { | ||
const UNPARSABLE_SVG = '<svg></svg'; | ||
|
||
expect(processSvg(UNPARSABLE_SVG)).rejects.toMatchSnapshot(); | ||
expect(optimizeSvg(UNPARSABLE_SVG)).rejects.toMatchSnapshot(); | ||
}); |