Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
tests: addInitialDataKey regression
Browse files Browse the repository at this point in the history
Test that initialDataKey is ignored in object decomposition. See #119.
  • Loading branch information
IlyaSemenov committed Oct 11, 2018
1 parent 06e59bd commit 2c2240e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/babel/__test__/addInitialDataKey.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,18 @@ describe('addInitialDataKey', () => {
)
expect(code.match(/initialDataKey:/g)).toHaveLength(2)
})

it('ignores object decomposition', () => {
const { code } = babel.transform(
`
const { getInitialData } = Component
`,
{
babelrc: false,
plugins: [require.resolve('../addInitialDataKey')],
filename: 'foo'
}
)
expect(code.match(/initialDataKey:/g)).toBeNull()
})
})

0 comments on commit 2c2240e

Please sign in to comment.