Missing esx.register of imported component
irudoy opened this issue · comments
irudoy commented
There are no esx.register
call when importing component with import
statement.
test('JSX component registration – import', async ({ is }) => {
const src = [
`import React from 'react'`,
`import Foo from './foo'`,
'module.exports = <div><Foo/></div>'
].join('\n')
const esx = [
`const esx = require('esx')()`,
`import React from 'react'`,
`import Foo from './foo'`,
'esx.register({ Foo })',
'module.exports = esx `<div><Foo/></div>`'
].join('\n')
is(convert(src), esx)
})
--- wanted
+++ found
const esx = require('esx')()
import React from 'react'
import Foo from './foo'
-esx.register({ Foo })
module.exports = esx `<div><Foo/></div>`