mirror of
https://github.com/strapi/strapi.git
synced 2025-11-14 01:02:04 +00:00
Merge pull request #19263 from strapi/v5/circular-deps
chore: remove last circular dep
This commit is contained in:
commit
d99fe11ceb
@ -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",
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
declare const strapi: any;
|
||||
@ -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;
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user