Initial commit.
This commit is contained in:
commit
b48a4e92e1
169 changed files with 7538 additions and 0 deletions
16
test/unit/image-resize.spec.js
Normal file
16
test/unit/image-resize.spec.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import assert from 'assert';
|
||||
import tmp from 'tmp';
|
||||
import resize from '../../lib/resize';
|
||||
|
||||
const file = fs.readFileSync(path.join(__dirname, '..', 'fixtures', 'utah-arches.jpg'));
|
||||
|
||||
describe('Image resizing', function() {
|
||||
it('should resize an image', function*() {
|
||||
const imageBuffer = yield resize(file, {height: 100, width: 100});
|
||||
const tmpFile = tmp.tmpNameSync();
|
||||
fs.writeFileSync(tmpFile + '.jpg', imageBuffer);
|
||||
assert(tmpFile);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue