🚀 optimize svg with csso

This commit is contained in:
platane
2020-11-04 10:09:02 +01:00
parent 817362d1dd
commit b71cd68bac
5 changed files with 57 additions and 19 deletions

View File

@@ -24,12 +24,12 @@ try {
} catch (err) {}
for (const [key, grid] of Object.entries(grids))
it(`should generate ${key} svg`, () => {
it(`should generate ${key} svg`, async () => {
const chain = [snake, ...getBestRoute(grid, snake)!];
const gif = createSvg(grid, chain, drawOptions, gifOptions);
const svg = await createSvg(grid, chain, drawOptions, gifOptions);
expect(gif).toBeDefined();
expect(svg).toBeDefined();
fs.writeFileSync(path.resolve(dir, key + ".svg"), gif);
fs.writeFileSync(path.resolve(dir, key + ".svg"), svg);
});