mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Replace rimraf with fs-extra.remove
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { IModuleState } from 'componentsjs';
|
||||
import { ComponentsManager } from 'componentsjs';
|
||||
import * as rimraf from 'rimraf';
|
||||
import { remove } from 'fs-extra';
|
||||
import { joinFilePath } from '../../src/util/PathUtil';
|
||||
|
||||
let cachedModuleState: IModuleState;
|
||||
@@ -38,8 +38,8 @@ export function getTestFolder(name: string): string {
|
||||
return joinFilePath(__dirname, '../tmp', name);
|
||||
}
|
||||
|
||||
export function removeFolder(folder: string): void {
|
||||
rimraf.sync(folder, { glob: false });
|
||||
export async function removeFolder(folder: string): Promise<void> {
|
||||
await remove(folder);
|
||||
}
|
||||
|
||||
export function getDefaultVariables(port: number, baseUrl?: string): Record<string, any> {
|
||||
|
||||
@@ -13,10 +13,10 @@ const podConfigJson = joinFilePath(rootFilePath, 'config-pod.json');
|
||||
|
||||
const configs: [string, any][] = [
|
||||
[ 'memory.json', {
|
||||
teardown: (): void => removeFolder(rootFilePath),
|
||||
teardown: async(): Promise<void> => removeFolder(rootFilePath),
|
||||
}],
|
||||
[ 'filesystem.json', {
|
||||
teardown: (): void => removeFolder(rootFilePath),
|
||||
teardown: async(): Promise<void> => removeFolder(rootFilePath),
|
||||
}],
|
||||
];
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const stores: [string, any][] = [
|
||||
}],
|
||||
[ 'on-disk storage', {
|
||||
storeConfig: 'storage/backend/file.json',
|
||||
teardown: (): void => removeFolder(rootFilePath),
|
||||
teardown: async(): Promise<void> => removeFolder(rootFilePath),
|
||||
}],
|
||||
];
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ const stores: [string, any][] = [
|
||||
}],
|
||||
[ 'on-disk storage', {
|
||||
storeConfig: 'storage/backend/file.json',
|
||||
teardown: (): void => removeFolder(rootFilePath),
|
||||
teardown: async(): Promise<void> => removeFolder(rootFilePath),
|
||||
}],
|
||||
];
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ const stores: [string, any][] = [
|
||||
}],
|
||||
[ 'on-disk storage', {
|
||||
storeConfig: 'storage/backend/file.json',
|
||||
teardown: (): void => removeFolder(rootFilePath),
|
||||
teardown: async(): Promise<void> => removeFolder(rootFilePath),
|
||||
}],
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user