fix(core): update
This commit is contained in:
11
test/test.ts
11
test/test.ts
@ -5,7 +5,7 @@ import * as smartfile from '@push.rocks/smartfile';
|
||||
let testSmartJimp: smartjimp.SmartJimp;
|
||||
|
||||
tap.test('first test', async () => {
|
||||
testSmartJimp = new smartjimp.SmartJimp();
|
||||
testSmartJimp = new smartjimp.SmartJimp({ mode: 'sharp'});
|
||||
expect(testSmartJimp).toBeInstanceOf(smartjimp.SmartJimp);
|
||||
});
|
||||
|
||||
@ -15,4 +15,13 @@ tap.test('should be able to create a master', async () => {
|
||||
(await smartfile.SmartFile.fromBuffer('.nogit/result.avif', convertedAsset)).write();
|
||||
});
|
||||
|
||||
tap.test('should be able to use jimp', async () => {
|
||||
const testSmartJimp = new smartjimp.SmartJimp({ mode: 'jimp'});
|
||||
const smartfileInstance = await smartfile.SmartFile.fromUrl('https://images.unsplash.com/photo-1673276628202-737bf3020ac2?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=3774&q=80')
|
||||
const convertedAsset = await testSmartJimp.computeAssetVariation(smartfileInstance.contents, {
|
||||
format: 'png',
|
||||
});
|
||||
(await smartfile.SmartFile.fromBuffer('.nogit/result2.png', convertedAsset)).write();
|
||||
})
|
||||
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user