Add Additional SSG Transform Test

This commit is contained in:
Joe Haddad 2019-12-05 18:06:35 -05:00
parent e76fc18675
commit 05ba91d3ba
No known key found for this signature in database
GPG key ID: C5B785A7D0DE1654

View file

@ -206,6 +206,24 @@ describe('babel plugin (next-ssg-transform)', () => {
)
})
it('should remove re-exported variable declarations (safe)', () => {
const output = babel(trim`
const unstable_getStaticPaths = () => {
return []
}, a = 2
export { unstable_getStaticPaths }
export default function Test() {
return <div />
}
`)
expect(output).toMatchInlineSnapshot(
`"const a=2;const __NEXT_COMP=function Test(){return __jsx(\\"div\\",null);};__NEXT_COMP.__NEXT_SPR=true export default __NEXT_COMP;"`
)
})
it('should remove re-exported function declarations', () => {
const output = babel(trim`
function unstable_getStaticPaths() {