Fix custom hook mocked path in api cli test (#15271)

* fix custom hook mocked path in api cli test

* update @types/jest

* update to latest

* update and pin dependencies

* correct pnpm lock

* remove unrelated changes
This commit is contained in:
Azri Kahar
2022-11-02 00:12:31 +08:00
committed by GitHub
parent 17c0ef9182
commit 5780bb174f

View File

@@ -1,3 +1,4 @@
import path from 'path';
import { Command } from 'commander';
import { Extension, HookConfig } from '@directus/shared/types';
import { createCli } from './index';
@@ -19,7 +20,8 @@ jest.mock('@directus/shared/utils/node/get-extensions', () => ({
getLocalExtensions: jest.fn(() => Promise.resolve([customCliExtension])),
}));
jest.mock(`/hooks/custom-cli/index.js`, () => customCliHook, { virtual: true });
const customHookPath = path.resolve('/hooks/custom-cli', 'index.js');
jest.doMock(customHookPath, () => customCliHook, { virtual: true });
const customCliExtension: Extension = {
path: `/hooks/custom-cli`,