Skip to content

Commit

Permalink
Adding failing tests for issue 762
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreeg authored and XhmikosR committed Mar 26, 2024
1 parent 6a6ae64 commit 85d9a3a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/spriter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,33 @@ describe('testing SVGSpriter', () => {
});
});
});

describe('testing transform', () => {
it('should call all transformations', async() => {
const testTransformFunction = jest.fn();
const spriter = new SVGSpriter({
shape: {
dest: 'svg',
transform: [
'svgo',
{
custom(_, __, callback) {
testTransformFunction();
callback(null);
}
}
]
}
});

spriter.add(new File({
base: path.dirname(TEST_SVG),
path: TEST_SVG,
contents: fs.readFileSync(path.join(__dirname, TEST_SVG))
}));

await spriter.compileAsync({ css: true });

expect(testTransformFunction).toHaveBeenCalledWith();
});
});

0 comments on commit 85d9a3a

Please sign in to comment.