本文整理匯總了TypeScript中react-plugin.loadPlugins函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript loadPlugins函數的具體用法?TypeScript loadPlugins怎麽用?TypeScript loadPlugins使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了loadPlugins函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('sends renderer response to renderer core', async () => {
register();
mockCore();
pluginMocks.mockMessageHandler({ postRendererRequest: () => {} });
const receiveResponse = jest.fn();
pluginMocks.mockRendererCore({ receiveResponse });
loadPlugins();
const rendererReadyRes: RendererReadyResponse = {
type: 'rendererReady',
payload: {
rendererId: 'mockRendererId',
fixtures: { 'ein.js': null, 'zwei.js': null, 'drei.js': null }
}
};
pluginMocks
.getMessageHandlerContext()
.emit('rendererResponse', rendererReadyRes);
await wait(() =>
expect(receiveResponse).toBeCalledWith(expect.any(Object), rendererReadyRes)
);
});
示例2: it
it('returns true', async () => {
registerTestPlugins();
loadPlugins();
mockRendererReady('mockRendererId', {});
expect(isRendererConnected()).toBe(true);
});
示例3: it
it('emits renderer response internally', async () => {
register();
mockCore();
loadPlugins();
await mockSocketIo(async ({ fakeEvent }) => {
const rendererReadyRes = {
type: 'rendererReady',
payload: {
rendererId: 'mockRendererId',
fixtures: { 'ein.js': null, 'zwei.js': null, 'drei.js': null }
}
};
const rendererResponse = jest.fn();
pluginMocks.onMessageHandler({ rendererResponse });
fakeEvent(RENDERER_MESSAGE_EVENT_NAME, rendererReadyRes);
await wait(() =>
expect(rendererResponse).toBeCalledWith(
expect.any(Object),
rendererReadyRes
)
);
});
});
示例4: it
it('returns true', async () => {
register();
pushUrlParams({ fullScreen: 'true' });
loadPlugins();
await wait(() => expect(getRouterMethods().isFullScreen()).toEqual(true));
});
示例5: it
it('updates fullscreen state', async () => {
register();
loadPlugins();
const router = getRouterMethods();
router.selectFixture(fixtureId, false);
await wait(() => expect(router.isFullScreen()).toBe(false));
});
示例6: it
it('returns null', async () => {
register();
loadPlugins();
await wait(() =>
expect(getRouterMethods().getSelectedFixtureId()).toBe(null)
);
});