Simplify tests

This commit is contained in:
Romain Faust
2018-08-23 19:25:56 +02:00
committed by GitHub
parent 9a6daf10c2
commit de1d976af9
+6 -18
View File
@@ -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) => { /* ... */ });