diff --git a/back/models/specs/images.spec.js b/back/models/specs/images.spec.js index a374fc0c0..465ffc624 100644 --- a/back/models/specs/images.spec.js +++ b/back/models/specs/images.spec.js @@ -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'); - });*/ }); });