mirror of
https://github.com/strapi/strapi.git
synced 2025-11-23 05:30:11 +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": {
|
"devDependencies": {
|
||||||
"@strapi/pack-up": "4.17.1",
|
"@strapi/pack-up": "4.17.1",
|
||||||
"@strapi/plugin-upload": "4.17.1",
|
"@strapi/types": "4.17.1",
|
||||||
"@types/jest": "29.5.2",
|
"@types/jest": "29.5.2",
|
||||||
"eslint-config-custom": "4.17.1",
|
"eslint-config-custom": "4.17.1",
|
||||||
"memfs": "4.6.0",
|
"memfs": "4.6.0",
|
||||||
|
|||||||
@ -5,27 +5,26 @@ jest.mock('fs', () => fs);
|
|||||||
|
|
||||||
import fse from 'fs-extra';
|
import fse from 'fs-extra';
|
||||||
|
|
||||||
import type { File } from '@strapi/plugin-upload';
|
|
||||||
|
|
||||||
import localProvider from '../index';
|
import localProvider from '../index';
|
||||||
|
|
||||||
describe('Local provider', () => {
|
describe('Local provider', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
globalThis.strapi = {};
|
global.strapi = {
|
||||||
globalThis.strapi.dirs = { static: { public: '' } };
|
dirs: { static: { public: '' } },
|
||||||
|
} as any;
|
||||||
|
|
||||||
fse.ensureDirSync('uploads');
|
fse.ensureDirSync('uploads');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
globalThis.strapi.dirs = undefined;
|
global.strapi.dirs = undefined as any;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('upload', () => {
|
describe('upload', () => {
|
||||||
test('Should have relative url to file object', async () => {
|
test('Should have relative url to file object', async () => {
|
||||||
const providerInstance = localProvider.init({});
|
const providerInstance = localProvider.init({});
|
||||||
|
|
||||||
const file: File = {
|
const file = {
|
||||||
name: 'test',
|
name: 'test',
|
||||||
size: 100,
|
size: 100,
|
||||||
url: '/',
|
url: '/',
|
||||||
@ -34,7 +33,7 @@ describe('Local provider', () => {
|
|||||||
ext: '.json',
|
ext: '.json',
|
||||||
mime: 'application/json',
|
mime: 'application/json',
|
||||||
buffer: Buffer.from(''),
|
buffer: Buffer.from(''),
|
||||||
};
|
} as any;
|
||||||
|
|
||||||
await providerInstance.upload(file);
|
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 fse from 'fs-extra';
|
||||||
import * as utils from '@strapi/utils';
|
import * as utils from '@strapi/utils';
|
||||||
|
|
||||||
|
import type {} from '@strapi/types';
|
||||||
|
|
||||||
interface File {
|
interface File {
|
||||||
name: string;
|
name: string;
|
||||||
alternativeText?: string;
|
alternativeText?: string;
|
||||||
|
|||||||
@ -10211,7 +10211,7 @@ __metadata:
|
|||||||
resolution: "@strapi/provider-upload-local@workspace:packages/providers/upload-local"
|
resolution: "@strapi/provider-upload-local@workspace:packages/providers/upload-local"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@strapi/pack-up": "npm:4.17.1"
|
"@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"
|
"@strapi/utils": "npm:4.17.1"
|
||||||
"@types/jest": "npm:29.5.2"
|
"@types/jest": "npm:29.5.2"
|
||||||
eslint-config-custom: "npm:4.17.1"
|
eslint-config-custom: "npm:4.17.1"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user