diff --git a/lib/babel/__test__/addInitialDataKey.test.js b/lib/babel/__test__/addInitialDataKey.test.js index 74d35c3..0787c88 100644 --- a/lib/babel/__test__/addInitialDataKey.test.js +++ b/lib/babel/__test__/addInitialDataKey.test.js @@ -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() + }) })