mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
Simplify tests
This commit is contained in:
@@ -1,21 +1,9 @@
|
||||
import imagemin = require('imagemin');
|
||||
|
||||
const input = ['/input/**/*'];
|
||||
const output = '/output/dir';
|
||||
const options = { plugins: [] };
|
||||
const handler = (result: imagemin.Result[]) => {
|
||||
// ...
|
||||
};
|
||||
imagemin(['*.png']).then((results: imagemin.Result[]) => { /* ... */ });
|
||||
imagemin(['*.png'], 'dist').then((results: imagemin.Result[]) => { /* ... */ });
|
||||
imagemin(['*.png'], { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ });
|
||||
imagemin(['*.png'], 'dist', { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ });
|
||||
|
||||
imagemin(input).then(handler);
|
||||
imagemin(input, output).then(handler);
|
||||
imagemin(input, options).then(handler);
|
||||
imagemin(input, output, options).then(handler);
|
||||
|
||||
const buffer = Buffer.from([ /* File content */ ]);
|
||||
const bufferHandler = (result: Buffer) => {
|
||||
// ...
|
||||
};
|
||||
|
||||
imagemin.buffer(buffer).then(bufferHandler);
|
||||
imagemin.buffer(buffer, options).then(bufferHandler);
|
||||
imagemin.buffer(Buffer.from[/* ... */]).then((result: Buffer) => { /* ... */ });
|
||||
imagemin.buffer(Buffer.from[/* ... */], { plugins: [] }).then((result: Buffer) => { /* ... */ });
|
||||
|
||||
Reference in New Issue
Block a user