Skip to content

Commit

Permalink
Merge pull request #19263 from strapi/v5/circular-deps
Browse files Browse the repository at this point in the history
chore: remove last circular dep
  • Loading branch information
alexandrebodin committed Jan 18, 2024
2 parents df87bd2 + 7d8495e commit d99fe11
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/providers/upload-local/package.json
Expand Up @@ -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",
Expand Down
Expand Up @@ -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: '/',
Expand All @@ -34,7 +33,7 @@ describe('Local provider', () => {
ext: '.json',
mime: 'application/json',
buffer: Buffer.from(''),
};
} as any;

await providerInstance.upload(file);

Expand Down
2 changes: 0 additions & 2 deletions packages/providers/upload-local/src/global.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/providers/upload-local/src/index.ts
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -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"
Expand Down

0 comments on commit d99fe11

Please sign in to comment.