refs #5576 test: image resize
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2023-11-20 14:58:04 +01:00
parent 18701abda6
commit 776055f167
1 changed files with 1 additions and 27 deletions

View File

@ -1,4 +1,3 @@
/* eslint-disable no-console */
const fs = require('fs-extra');
const models = require('vn-loopback/server/server').models;
const LoopBackContext = require('loopback-context');
@ -8,7 +7,7 @@ let obj = {};
const STORAGE_IMAGE_USER = 'storage/image/user';
const _23_F2 = '23/f2';
const FULL_23_F2 = `full/${_23_F2}`;
fdescribe('loopback model Image', () => {
describe('loopback model Image', () => {
const userId = 1107;
const activeCtx = {
@ -74,33 +73,8 @@ fdescribe('loopback model Image', () => {
afterAll(async() => {
await fs.unlink(`${STORAGE_IMAGE_USER}/full/${nameItem}`);
try {
await fs.unlink(`${STORAGE_IMAGE_USER}/160x160/${nameItem}`);
} catch (e) {
expect(e).toBeDefined();
}
// fs.stat(`${STORAGE_IMAGE_USER}/160x160/${_23_F2}/${nameItem}.png`, (err, data) => {
// if (err) console.error(err);
// fs.unlink(`${STORAGE_IMAGE_USER}/160x160/${_23_F2}/${nameItem}.png`);
// });
// console.info('deleted');
await fs.unlink(`${STORAGE_IMAGE_USER}/520x520/${nameItem}`);
await fs.unlink(`${STORAGE_IMAGE_USER}/1600x1600/${nameItem}`);
/* fs.access(`${STORAGE_IMAGE_USER}/1600x1600/${_23_F2}/${nameItem}.png`, (err, data) => {
if (err) console.error(err);
fs.unlink(`${STORAGE_IMAGE_USER}/1600x1600/${_23_F2}/${nameItem}.png`);
console.info('deleted');
});
fs.stat(`${STORAGE_IMAGE_USER}/520x520/${_23_F2}/${nameItem}.png`, (err, data) => {
if (err) console.error(err);
fs.unlink(`${STORAGE_IMAGE_USER}/520x520/${_23_F2}/${nameItem}.png`);
console.info('deleted');
});
fs.stat(`${STORAGE_IMAGE_USER}/${FULL_23_F2}/${nameItem}.png`, (err, data) => {
if (err) console.error(err);
fs.unlink(`${STORAGE_IMAGE_USER}/${FULL_23_F2}/${nameItem}.png`);
console.info('deleted');
});*/
});
});