小编Rki*_*g14的帖子

使用Minikube的Docker中的Hyper-v和VirtualBox冲突

我正在尝试在Windows 10企业版上使用Minikube扩展Docker容器。但是,我遇到了与Hyper-V和VirtualBox的一些冲突。我知道Docker需要Hyper-V才能正常运行,而Minikube需要VirtualBox才能运行(如果启用了Hyper-V,则会显示错误)

C:\WINDOWS\system32>minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
160.27 MB / 160.27 MB [============================================] 100.00% 
0s
E0822 11:42:07.898412   13028 start.go:174] Error starting host: Error 
creating host: Error executing step: Running precreate checks.
: This computer is running Hyper-V. VirtualBox won't boot a 64bits VM when 
Hyper-V is activated. Either use Hyper-V as a driver, or disable the Hyper-V 
hypervisor. (To skip this check, use --virtualbox-no-vtx-check).
Run Code Online (Sandbox Code Playgroud)

如果禁用Hyper-V,则可以正常启动minikube,但Docker无法正常工作,并显示启用Hyper-V的错误。

我也尝试使用Hyper-V驱动程序运行minikube,但也收到此错误:

C:\WINDOWS\system32>minikube start --vm-driver hyperv
Starting local Kubernetes …
Run Code Online (Sandbox Code Playgroud)

virtualbox hyper-v docker kubernetes minikube

6
推荐指数
1
解决办法
3829
查看次数

在 JEST 中嘲笑 i18n 的 useTranslation 不起作用

我的 React 组件使用 i18next 的翻译,我正在尝试使用 JEST 为其创建测试。但是,没有任何内容被翻译,我尝试模拟下面的 useTranslation 函数:

const useMock : any = [(k: any) => k, {}];
useMock.t = (k: any) => k;
useMock.i18n = {};

jest.mock('react-i18next', () => ({
  // this mock makes sure any components using the translate HoC receive the t function as a prop
  /* tslint:disable-next-line:variable-name */
  useTranslation: () => useMock,
}));
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

typescript i18next jestjs react-i18next ts-jest

6
推荐指数
1
解决办法
2万
查看次数