mirror of
https://github.com/directus/directus.git
synced 2026-02-16 17:35:39 -05:00
21 lines
636 B
TypeScript
21 lines
636 B
TypeScript
import { listFolders } from '../../../src/utils/node/list-folders';
|
|
import { dirSync, SynchrounousResult } from 'tmp';
|
|
|
|
describe('', () => {
|
|
let rootDir: SynchrounousResult;
|
|
let childDir: SynchrounousResult;
|
|
|
|
beforeEach(() => {
|
|
rootDir = dirSync({ unsafeCleanup: true, tmpdir: './' } as any);
|
|
childDir = dirSync({ tmpdir: rootDir.name } as any);
|
|
});
|
|
|
|
afterEach(() => {
|
|
rootDir.removeCallback();
|
|
});
|
|
it('returns all the subdirectories of the current directory', async () => {
|
|
const childPath = childDir.name.split('/');
|
|
expect(await listFolders(rootDir.name)).toStrictEqual([childPath[childPath?.length - 1]]);
|
|
});
|
|
});
|