Skip to content

Commit

Permalink
test: make tests cross-platform
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Aug 5, 2021
1 parent b720a9a commit 74e21de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ $ imagemin --help
$ imagemin foo.png > foo-optimized.png
$ cat foo.png | imagemin > foo-optimized.png
$ imagemin foo.png --plugin=pngquant > foo-optimized.png
$ imagemin foo.png --plugin.pngquant.quality={0.5,1} > foo-optimized.png
$ imagemin foo.png --plugin.pngquant.quality=0.5 --plugin.pngquant.quality=1 > foo-optimized.png
$ imagemin foo.png --plugin.webp.quality=95 --plugin.webp.preset=icon > foo-icon.webp
```

**macOS** users can also use the short CLI syntax for array arguments:
`--plugin.pngquant.quality={0.5,1}` equals
`--plugin.pngquant.quality=0.5 --plugin.pngquant.quality=1`

## Related

- [imagemin](https://github.com/imagemin/imagemin) - API for this module
3 changes: 1 addition & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ test('throw on missing plugins', async t => {
test('support plugin options', async t => {
const input = await readFile('fixtures/test.png');

const {stdout: data} = await execa('./cli.js', ['--plugin.pngquant.dithering=1', '--plugin.pngquant.quality={0.1,0.4}'], {
const {stdout: data} = await execa('./cli.js', ['--plugin.pngquant.dithering=1', '--plugin.pngquant.speed=0.1', '--plugin.pngquant.quality=0.4'], {
input,
encoding: 'buffer',
shell: true,
});

const {stdout: compareData} = await execa('./cli.js', {
Expand Down

0 comments on commit 74e21de

Please sign in to comment.