mirror of
https://github.com/directus/directus.git
synced 2026-02-04 08:45:11 -05:00
* Move format title to dedicated repo * Move CLI as well * Move create-directus-extension * Move create-directus-project * Move extensions sdk * Move gatsby-source-directus * Move sdk * Remove sdk from jest config * Regen package-lock * Add missing tmp types * Fix test import names * Missed one
24 lines
771 B
TypeScript
24 lines
771 B
TypeScript
import { resolvePackage } from '../../../src/utils/node/resolve-package';
|
|
import { dirSync, DirResult } from 'tmp';
|
|
import { ensureDirSync, writeJsonSync } from 'fs-extra';
|
|
import path from 'path';
|
|
|
|
describe('', () => {
|
|
let rootDir: DirResult;
|
|
beforeEach(() => {
|
|
rootDir = dirSync({ unsafeCleanup: true, tmpdir: './' } as any);
|
|
ensureDirSync(`${rootDir.name}/node_modules/`);
|
|
ensureDirSync(`${rootDir.name}/node_modules/test-package/`);
|
|
writeJsonSync(`${rootDir.name}/node_modules/test-package/package.json`, { name: 'test' });
|
|
});
|
|
|
|
afterEach(() => {
|
|
rootDir.removeCallback();
|
|
});
|
|
it('the package to be found', () => {
|
|
expect(resolvePackage('test-package', rootDir.name)).toBe(
|
|
path.resolve(`${rootDir.name}/node_modules/test-package`)
|
|
);
|
|
});
|
|
});
|