Merge pull request #19263 from strapi/v5/circular-deps

chore: remove last circular dep
This commit is contained in:
Alexandre BODIN 2024-01-18 18:48:15 +01:00 committed by GitHub
commit d99fe11ceb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 11 deletions

View File

@ -48,7 +48,7 @@
},
"devDependencies": {
"@strapi/pack-up": "4.17.1",
"@strapi/plugin-upload": "4.17.1",
"@strapi/types": "4.17.1",
"@types/jest": "29.5.2",
"eslint-config-custom": "4.17.1",
"memfs": "4.6.0",

View File

@ -5,27 +5,26 @@ jest.mock('fs', () => fs);
import fse from 'fs-extra';
import type { File } from '@strapi/plugin-upload';
import localProvider from '../index';
describe('Local provider', () => {
beforeAll(() => {
globalThis.strapi = {};
globalThis.strapi.dirs = { static: { public: '' } };
global.strapi = {
dirs: { static: { public: '' } },
} as any;
fse.ensureDirSync('uploads');
});
afterAll(() => {
globalThis.strapi.dirs = undefined;
global.strapi.dirs = undefined as any;
});
describe('upload', () => {
test('Should have relative url to file object', async () => {
const providerInstance = localProvider.init({});
const file: File = {
const file = {
name: 'test',
size: 100,
url: '/',
@ -34,7 +33,7 @@ describe('Local provider', () => {
ext: '.json',
mime: 'application/json',
buffer: Buffer.from(''),
};
} as any;
await providerInstance.upload(file);

View File

@ -1,2 +0,0 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const strapi: any;

View File

@ -4,6 +4,8 @@ import path from 'path';
import fse from 'fs-extra';
import * as utils from '@strapi/utils';
import type {} from '@strapi/types';
interface File {
name: string;
alternativeText?: string;

View File

@ -10211,7 +10211,7 @@ __metadata:
resolution: "@strapi/provider-upload-local@workspace:packages/providers/upload-local"
dependencies:
"@strapi/pack-up": "npm:4.17.1"
"@strapi/plugin-upload": "npm:4.17.1"
"@strapi/types": "npm:4.17.1"
"@strapi/utils": "npm:4.17.1"
"@types/jest": "npm:29.5.2"
eslint-config-custom: "npm:4.17.1"