diff --git a/src/element/index.ts b/src/element/index.ts index bd873161..1fd8a6e7 100644 --- a/src/element/index.ts +++ b/src/element/index.ts @@ -1,2 +1,3 @@ -export { createElement } from './create'; -export { jsx } from './jsx'; +export * from './create'; +export * from './jsx'; +export * from './valid'; diff --git a/src/render/gameobject.ts b/src/render/gameobject.ts index 48fdfa66..e5eab03c 100644 --- a/src/render/gameobject.ts +++ b/src/render/gameobject.ts @@ -1,10 +1,8 @@ import Phaser from 'phaser'; import type { JSX } from 'react'; -import { isValidElement } from '../element/valid'; -import { createContainer } from './container'; -import { setProps } from './props'; -import { attachRef } from './ref'; +import { isValidElement } from '../element'; +import { attachRef, createContainer, setProps } from '.'; /** * Creates Phaser game object and adds it to the container. diff --git a/src/render/index.ts b/src/render/index.ts index 5392708b..d9b53d4f 100644 --- a/src/render/index.ts +++ b/src/render/index.ts @@ -1 +1,5 @@ -export { render } from './render'; +export * from './container'; +export * from './gameobject'; +export * from './props'; +export * from './ref'; +export * from './render'; diff --git a/src/render/render.test.ts b/src/render/render.test.ts index 5af6da69..4f3fa590 100644 --- a/src/render/render.test.ts +++ b/src/render/render.test.ts @@ -24,6 +24,7 @@ jest.mock('./container', () => ({ })); it('does not render element into the scene', () => { + const spy = jest.spyOn(console, 'warn').mockImplementation(); const scene = new Phaser.Scene(); scene.add = {} as Phaser.GameObjects.GameObjectFactory; scene.add.existing = jest.fn(); @@ -31,6 +32,8 @@ it('does not render element into the scene', () => { expect(render(element, scene)).toBe(undefined); expect(scene.add.existing).not.toBeCalled(); expect(mockContainerAdd).not.toBeCalled(); + expect(spy).toBeCalledTimes(1); + spy.mockRestore(); }); it('renders element into the scene', () => { diff --git a/src/render/render.ts b/src/render/render.ts index 3f23f6bc..a2cbdd0e 100644 --- a/src/render/render.ts +++ b/src/render/render.ts @@ -1,8 +1,7 @@ import Phaser from 'phaser'; import type { JSX } from 'react'; -import { createContainer } from './container'; -import { createGameObject } from './gameobject'; +import { createContainer, createGameObject } from '.'; /** * Renders a piece of JSX into a Phaser scene.